Part Number Hot Search : 
NJG1551 MAX1556 SIEMENS DS17285 MBZ27 0PFTN KE400A E000367
Product Description
Full Text Search
 

To Download T89C5115-TISIM Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  rev. 4128a?8051?04/02 1 features  80c51 core architecture  256 bytes of on-chip ram  256 bytes of on-chip eram ? 16-kb of on-chip flash memory ? data retention: 10 years at 85 c ? read/write cycle: 10k  2k bytes of on-chip flash for bootloader  2k bytes of on-chip eeprom ? read/write cycle: 100k  14-sources 4-level interrupts  three 16-bit timers/counters  full duplex uart compatible 80c51  maximum crystal frequency 40 mhz ? inx2mode,20mhz(cpucore,40mhz)  three or four ports: 16 or 20 digital i/o lines  two-channel 16-bit pca with: ? pwm (8-bit) ? high-speed output ? timer and edge capture  double data pointer  21-bit watchdog timer (7 programmable bits)  a 10-bit resolution analog to digital converter (adc) with 8 multiplexed inputs  power saving modes: ? idle mode ? power-down mode  power supply: 5v 10% (or 3v (1) 10%)  temperature range: industrial (-40 to +85 c)  packages: soic28, plcc28, vqfp32 note: 1. ask for availability description the t89c5115 is a high performance flash version of the 80c51 single chip 8-bit microcontrollers. it contains a 16-kb flash memory block for program and data. the 16-kb flash memory can be programmed either in parallel mode or in serial mode with the isp capability or with software. the programming voltage is internally generated from the standard vcc pin. the t89c5115 retains all features of the 80c52 with 256 bytes of internal ram, a 7- source 4-level interrupt controller and three timer/counters. in addition, the t89c5115 has a 10-bit a/d converter, a 2-kb boot flash memory, 2-kb eeprom for data, a programmable counter array, an eram of 256 bytes, a hardware watchdog timer and a more versatile serial channel that facilitates multiprocessor communication (euart). the fully static design of the t89c5115 reduces system power consumption by bringing the clock frequency down to any value, even dc, without loss of data. the t89c5115 has two software-selectable modes of reduced activity and an 8 bit clock prescaler for further reduction in power consumption. in the idle mode the cpu is frozen while the peripherals and the interrupt system are still operating. in the power-down mode the ram is saved and all other functions are inoperative. the added features of the t89c5115 make it more powerful for applications that need a/d conversion, pulse width modulation, high speed i/o and counting capabilities such as industrial control, consumer goods, alarms, motor control, etc. while remain- ing fully compatible with the 80c52 it offers a superset of this standard microcontroller. low pin count 8-bit mcu with a/d converter and 16-kbytes of flash memory t89c5115
2 t89c5115 4128a?8051?04/02 in x2 mode a maximum external clock rate of 20 mhz reaches a 300 ns cycle time. block diagram notes: 1. 8 analog inputs/8 digital i/o 2. 2-bit i/o port timer 0 int ram 256x8 t0 t1 rxd txd xtal2 xtal1 uart cpu timer 1 int1 ctrl int0 c51 core p2 (2) port 1 port 2 port 3 parallel i/o ports & ext. bus p1 (1) p3 eram 256x8 ib-bus pca reset watch dog pca eci vss vcc timer2 t2ex t2 port 4 p4 (2) 10-bit adc flash 16kx8 boot loader 2kx8 eeprom 2kx8
3 t89c5115 4128a?8051?04/02 pin configuration p3.4/t0 p3.3/int1 p4.1 1 p3.7 p3.2/int0 p1.5/an5 p1.7/an7 p1.6/an6 p2.0 varef vavcc vagnd p1.0/ an0/t2 p1.1/an1/t2ex p1.2/an2/eci p1.3/an3/cex0 p1.4/an4/cex1 2 3 4 5 6 7 8 9 10 11 12 28 27 26 25 24 23 22 21 20 19 18 17 rese t vcc vss p4.0 p2.1 p3.6 p3.5/t1 p3.1/txd 13 p3.0/rxd 14 16 xtal1 15 xtal2 so28 p1.3/an3/cex0 p1.2/an2/eci p1.1/an1/t2ex p1.0/an 0/t2 varef vagnd reset vss vcc xtal1 xtal2 p3.7 p4.0 p4.1 p2.1 p3.6 25 24 23 22 21 20 19 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 3 2 p2.0 p1.4/an4/cex1 p1.5/an5 p1.6/an6 p1.7/an7 p3.0/rxd p3.1/txd p3.2/int0 p3.3/int1 p3.4/t0 p3.5/t1 1 28 27 26 vavcc plcc-28 p1.3/an3/cex0 p1.2/an2/eci p1.1/an1/t2ex p1.0/an 0/t2 varef vagnd reset vss vcc xtal1 xtal2 p3.7 p4.0 p4.1 p2.1 p3.6 p2.0 p1.4/an4/cex1 p1.5/an5/cex2 p1.6/an6/cex3 p1.7/an7/cex4 p3.0/rxd p3.1/txd p3.2/int0 p3.3/int1 p3.4/t0 p3.5/t1 vavcc qfp-32 nc nc nc nc 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 23 24 25 26 27 28 29 30 31 32 22
4 t89c5115 4128a?8051?04/02 table 1. pin description pin name type description vss gnd circuit ground vcc supply voltage varef reference voltage for adc vavcc supply voltage for adc vagnd reference ground for adc p1.0:7 i/o port 1: is an 8-bit bi-directional i/o port with internal pull-ups. port 1 pins can be used for digital input/output or as analog inputs for the analog digital converter (adc). port 1 pins that have 1?s written to them are pulled high by the internal pull-up transistors and can be used as inputs in this state. as inputs, port 1 pins that are being pulled low externally will be the source of current (i il , see section "electrical characteristic") because of the internal pull-ups. port 1 pins are assigned to be used as analog inputs via the adccf register (in this case the internal pull-ups are disconnected). as a secondary digital function, port 1 contains the timer 2 external trigger and clock input; the pca external clock input and the pca module i/o. p1.0/an0/t2 analog input channel 0, external clock input for timer/counter2. p1.1/an1/t2ex analog input channel 1, trigger input for timer/counter2. p1.2/an2/eci analog input channel 2, pca external clock input. p1.3/an3/cex0 analog input channel 3, pca module 0 entry of input/pwm output. p1.4/an4/cex1 analog input channel 4, pca module 1 entry of input/pwm output. p1.5/an5 analog input channel 5, p1.6/an6 analog input channel 6, p1.7/an7 analog input channel 7, it can drive cmos inputs without external pull-ups. p2.0:7 i/o port 2: is an 2-bit bi-directional i/o port with internal pull-ups. port 2 pins that have 1?s written to them are pulled high by the internal pull-ups and can be used as inputs in this state. as inputs, port 2 pins that are being pulled low externally will be a source of current (iil, on the datasheet) because of the internal pull-ups. inthet89c51cc02port2cansinkorsource5ma.itcandrivecmosinputs without external pull-ups.
5 t89c5115 4128a?8051?04/02 p3.0:7 i/o port 3: is an 8-bit bi-directional i/o port with internal pull-ups. port 3 pins that have 1?s written to them are pulled high by the internal pull-up transistors and can be used as inputs in this state. as inputs, port 3 pins that are being pulled low externally will be a source of current (i il , see section "electrical characteristic") because of the internal pull-ups. the output latch corresponding to a secondary function must be programmed to one for that function to operate (except for txd ). the secondary functions are assigned to the pins of port 3 as follows: p3.0/rxd: receiver data input (asynchronous) or data input/output (synchronous) of the serial interface p3.1/txd: transmitter data output (asynchronous) or clock output (synchronous) of the serial interface p3.2/int0 : external interrupt 0 input/timer 0 gate control input p3.3/int1 : external interrupt 1 input/timer 1 gate control input p3.4/t0: timer 0 counter input p3.5/t1: timer 1 counter input it can drive cmos inputs without external pull-ups. p4.0:1 i/o port 4: is an 2-bit bi-directional i/o port with internal pull-ups. port 4 pins that have 1?s written to them are pulled high by the internal pull-ups and can be used as inputs in this state. as inputs, port 4 pins that are being pulled low externally will be a source of current (iil, on the datasheet) because of the internal pull-up transistor. it can drive cmos inputs without external pull-ups. reset i/o reset: a high level on this pin during two machine cycles while the oscillator is running resets the device. an internal pull-down resistor to vss permits power-on reset using only an external capacitor to vcc. xtal1 i xtal1: input of the inverting oscillator amplifier and input of the internal clock generator circuits. to drive the device from an external clock source, xtal1 should be driven, while xtal2 is left unconnected. to operate above a frequency of 16 mhz, a duty cycle of 50% should be maintained. xtal2 o xtal2: output from the inverting oscillator amplifier. table 1. pin description (continued) pin name type description
6 t89c5115 4128a?8051?04/02 i/o configurations each port sfr operates via type-d latches, as illustrated in figure 1 for ports 3 and 4. a cpu "write to latch" signal initiates transfer of internal bus data into the type-d latch. a cpu "read latch" signal transfers the latched q output onto the internal bus. similarly, a "read pin" signal transfers the logical level of the port pin. some port data instructions activate the "read latch" signal while others activate the "read pin" signal. latch instruc- tions are referred to as read-modify-write instructions. each i/o line may be independently programmed as input or output. port structure figure 1 shows the structure of ports, which have internal pull-ups. an external source can pull the pin low. each port pin can be configured either for general-purpose i/o or for its alternate input output function. to use a pin for general-purpose output, set or clear the corresponding bit in the px reg- ister (x = 1 to 4). to use a pin for general-purpose input, set the bit in the px register. this turns off the output fet drive. to configure a pin for its alternate function, set the bit in the px register. when the latch is set, the "alternate output function" signal controls the output level (see figure 1). the operation of ports is discussed further in "quasi-bidirectional port operation" paragraph. figure 1. ports structure note: the internal pull-up can be disabled on p1 when analog function is selected. d cl q latch internal write to latch read pin read latch p1.x alternate output function vcc internal pull-up (1) alternate input function bus p2.x p3.x p4.x
7 t89c5115 4128a?8051?04/02 read-modify-write instructions some instructions read the latch data rather than the pin data. the latch based instruc- tions read the data, modify the data and then rewrite the latch. these are called "read- modify-write" instructions. below is a complete list of these special instructions (see table ). when the destination operand is a port or a port bit, these instructions read the latch rather than the pin: it is not obvious the last three instructions in this list are read-modify-write instructions. these instructions read the port (all 8 bits), modify the specifically addressed bit and write the new byte back to the latch. these read-modify-write instructions are directed to the latch rather than the pin in order to avoid possible misinterpretation of voltage (and therefore, logic) levels at the pin. for example, a port bit used to drive the base of an external bipolar transistor can not rise above the transistor?s base-emitter junction voltage (a value lower than vil). with a logic one written to the bit, attempts by the cpu to read the port at the pin are misinterpreted as logic zero. a read of the latch rather than the pins returns the correct logic-one value. quasi-bidirectional port operation port 1, port 3 and port 4 have fixed internal pull-ups and are referred to as "quasi-bidi- rectional" ports. when configured as an input, the pin impedance appears as logic one and sources current in response to an external logic zero condition. resets write logic one to all port latches. if logical zero is subsequently written to a port latch, it can be returned to input conditions by a logical one written to the latch. note: port latch values change near the end of read-modify-write insruction cycles. output buffers (and therefore the pin state) update early in the instruction after read-modify- write instruction cycle. logical zero-to-one transitions in port 1, port 3 and port 4 use an additional pull-up (p1) to aid this logic transition see figure 2. this increases switch speed. this extra pull-up sources 100 times normal internal circuit current during 2 oscillator clock periods. the internal pull-ups are field-effect transistors rather than linear resistors. pull-ups consist of three p-channel fet (pfet) devices. a pfet is on when the gate senses logical zero and off when the gate senses logical one. pfet #1 is turned on for two oscillator periods immediately after a zero-to-one transition in the port latch. a logical one at the port pin turns on pfet #3 (a weak pull-up) through the inverter. this inverter and pfet pair form a latch to drive logical one. pfet #2 is a very weak pull-up switched on whenever the table 2. read-modify-write instructions instruction description example anl logical and anl p1, a orl logical or orl p2, a xrl logical ex-or xrl p3, a jbc jump if bit = 1 and clear bit jbc p1.1, label cpl complement bit cpl p3.0 inc increment inc p2 dec decrement dec p2 djnz decrement and jump if not zero djnz p3, label mov px.y, c move carry bit to bit y of port x mov p1.5, c clr px.y clear bit y of port x clr p2.4 set px.y set bit y of port x set p3.3
8 t89c5115 4128a?8051?04/02 associated nfet is switched off. this is traditional cmos switch convention. current strengths are 1/10 that of pfet #3 figure 2. internal pull-up configurations read pin input data p1.x output data 2 osc. periods n p1(1) p2 p3 vcc vcc vcc p2.x p3.x p4.x
9 t89c5115 4128a?8051?04/02 sfr mapping the special function registers (sfrs) of the t89c5115 fall into the following categories: table 3. c51coresfrs mnemonicaddname 76543210 acce0haccumulator ???????? b f0hbregister ???????? psw d0h program status word cy ac f0 rs1 rs0 ov f1 p sp81hstackpointer ???????? dpl 82h data pointer low byte lsb of dptr ???????? dph 83h data pointer high byte msb of dptr ???????? table 4. i/o port sfrs mnemonicaddname 76543210 p190hport1 ???????? p2a0hport2(x2) ???????? p3b0hport3 ???????? p4c0hport4(x2) ???????? table 5. timers sfrs mnemonicaddname 76543210 th0 8ch timer/counter 0 high byte ???????? tl0 8ah timer/counter 0 low byte ???????? th1 8dh timer/counter 1 high byte ???????? tl1 8bh timer/counter 1 low byte ???????? th2 cdh timer/counter 2 high byte ???????? tl2 cch timer/counter 2 low byte ???????? tcon 88h timer/counter 0 and 1 control tf1 tr1 tf0 tr0 ie1 it1 ie0 it0 tmod 89h timer/counter 0 and 1 modes gate1 c/t1# m11 m01 gate0 c/t0# m10 m00
10 t89c5115 4128a?8051?04/02 t2con c8h timer/counter 2 control tf2 exf2 rclk tclk exen2 tr2 c/t2# cp/rl2# t2mod c9h timer/counter 2 mode ??????t2oedcen rcap2h cbh timer/counter 2 reload/capture high byte ???????? rcap2l cah timer/counter 2 reload/capture low byte ???????? wdtrst a6h watchdog timer reset ???????? wdtprg a7h watchdog timer program ?????s2s1s0 table 5. timers sfrs (continued) mnemonicaddname 76543210 table 6. serial i/o port sfrs mnemonicaddname 76543210 scon 98h serial control fe/sm0 sm1 sm2 ren tb8 rb8 ti ri sbuf99hserialdatabuffer???????? sadenb9hslaveaddressmask???????? saddra9hslaveaddress ???????? table 7. pca sfrs mnemo -nicaddname 76543210 ccon d8h pca timer/counter control cf cr ? ccf4 ccf3 ccf2 ccf1 ccf0 cmod d9h pca timer/counter mode cidl wdte ? ? ? cps1 cps0 ecf cle9hpcatimer/counterlowbyte ???????? ch f9h pca timer/counter high byte ? ? ? ? ? ? ? ? ccapm0 ccapm1 dah dbh pca timer/counter mode 0 pca timer/counter mode 1 ? ecom0 ecom1 capp0 capp1 capn0 capn1 mat0 mat1 tog0 tog1 pwm0 pwm1 eccf0 eccf1 ccap0h ccap1h fah fbh pca compare capture module 0 h pca compare capture module 1 h ccap0h7 ccap1h7 ccap0h6 ccap1h6 ccap0h5 ccap1h5 ccap0h4 ccap1h4 ccap0h3 ccap1h3 ccap0h2 ccap1h2 ccap0h1 ccap1h1 ccap0h0 ccap1h0 ccap0l ccap1l eah ebh pca compare capture module 0 l pca compare capture module 1 l ccap0l7 ccap1l7 ccap0l6 ccap1l6 ccap0l5 ccap1l5 ccap0l4 ccap1l4 ccap0l3 ccap1l3 ccap0l2 ccap1l2 ccap0l1 ccap1l1 ccap0l0 ccap1l0
11 t89c5115 4128a?8051?04/02 table 8. interrupt sfrs mnemonicaddname 76543210 ien0 a8h interrupt enable control 0 ea ec et2 es et1 ex1 et0 ex0 ien1 e8h interrupt enable control 1 ??????eadc? ipl0 b8h interrupt priority control low 0 ? ppc pt2 ps pt1 px1 pt0 px0 iph0 b7h interrupt priority control high 0 ? ppch pt2h psh pt1h px1h pt0h px0h ipl1 f8h interrupt priority control low 1 ??????padcl? iph1 f7h interrupt priority control high1 ??????padch? table 9. adc sfrs mnemonicaddname 76543210 adcon f3h adc control ? psidle aden adeoc adsst sch2 sch1 sch0 adcf f6h adc configuration ch7 ch6 ch5 ch4 ch3 ch2 ch1 ch0 adclk f2h adc clock ? ? ? prs4 prs3 prs2 prs1 prs0 addh f5h adc data high byte adat9 adat8 adat7 adat6 adat5 adat4 adat3 adat2 addlf4hadcdatalowbyte??????adat1adat0 table 10. other sfrs mnemonicaddname 76543210 pcon 87h power control smod1 smod0 ? pof gf1 gf0 pd idl auxr1 a2h auxiliary register 1 ? ? enboot ? gf3 0 ? dps ckcon 8fh clock control ? wdx2 pcax2 six2 t2x2 t1x2 t0x2 x2 fcon d1h flash control fpl3 fpl2 fpl1 fpl0 fps fmod1 fmod0 fbusy eecon d2h eeprom contol eepl3 eepl2 eepl1 eepl0 ? ? eee eebusy
12 t89c5115 4128a?8051?04/02 reserved note: 1. these registers are bit-addressable. sixteen addresses in the sfr space are both byte-addressable and bit-addressable. the bit-addressable sfr?s are those whose address ends in 0 and 8. the bit addresses, in this area, are 0x80 through to 0xff. table 11. sfr mapping 0/8 (1) 1/9 2/a 3/b 4/c 5/d 6/e 7/f f8h ipl1 xxxx x000 ch 0000 0000 ccap0h 0000 0000 ccap1h 0000 0000 ffh f0h b 0000 0000 adclk xxx0 0000 adcon x000 0000 addl 0000 0000 addh 0000 0000 adcf 0000 0000 iph1 xxxx x000 f7h e8h ien1 xxxx x000 cl 0000 0000 ccap0l 0000 0000 ccap1l 0000 0000 efh e0h acc 0000 0000 e7h d8h ccon 0000 0000 cmod 00xx x000 ccapm0 x000 0000 ccapm1 x000 0000 df h d0h psw 0000 0000 fcon 0000 0000 eecon xxxx xx00 d7h c8h t2con 0000 0000 t2mod xxxx xx00 rcap2l 0000 0000 rcap2h 0000 0000 tl2 0000 0000 th2 0000 0000 cf h c0h p4 xxxx xx11 c7h b8h ipl0 x000 0000 saden 0000 0000 bfh b0h p3 1111 1111 iph0 x000 0000 b7h a8h ien0 0000 0000 saddr 0000 0000 afh a0h p2 1111 1111 auxr1 xxxx 00x0 wdtrst 1111 1111 wdtprg xxxx x000 a7h 98h scon 0000 0000 sbuf 0000 0000 9fh 90h p1 1111 1111 97h 88h tcon 0000 0000 tmod 0000 0000 tl0 0000 0000 tl1 0000 0000 th0 0000 0000 th1 0000 0000 ckcon 0000 0000 8fh 80h p0 1111 1111 sp 0000 0111 dpl 0000 0000 dph 0000 0000 pcon 00x1 0000 87h 0/8 (1) 1/9 2/a 3/b 4/c 5/d 6/e 7/f
13 t89c5115 4128a?8051?04/02 clock the t89c5115 core needs only 6 clock periods per machine cycle. this feature, called ?x2?, provides the following advantages:  divides frequency crystals by 2 (cheaper crystals) while keeping the same cpu power.  saves power consumption while keeping the same cpu power (oscillator power saving).  saves power consumption by dividing dynamic operating frequency by 2 in operating and idle modes.  increases cpu power by 2 while keeping the same crystal frequency. in order to keep the original c51 compatibility, a divider-by-2 is inserted between the xtal1 signal and the main clock input of the core (phase generator). this divider may be disabled by the software. an extra feature is available to start after reset in the x2 mode. this feature can be enabled by a bit x2b in the hardware security byte. this bit is described in the section "in-system programming". description the x2 bit in the ckcon register (see table 12) allows switching from 12 clock cycles per instruction to 6 clock cycles and vice versa. at reset, the standard speed is activated (std mode). setting this bit activates the x2 feature (x2 mode) for the cpu clock only (see figure 3.). the timers 0, 1 and 2, uart, pca or watchdog switch in x2 mode only if the corre- sponding bit is cleared in the ckcon register. the clock for the whole circuit and peripheral is first divided by two before being used by the cpu core and peripherals. this allows any cyclic ratio to be accepted on the xtal1 input. in x2 mode, as this divider is bypassed, the signals on xtal1 must have a cyclic ratio between 40 to 60%. figure 3. shows the clock generation block diagram. the x2 bit is validated on the xtal1 2 rising edge to avoid glitches when switching from the x2 to the std mode. figure 4 shows the mode switching waveforms.
14 t89c5115 4128a?8051?04/02 figure 3. clock cpu generation diagram xtal1 xtal2 pd pcon.1 cpu core 1 0 2 periph clock clock peripheral clock symbol cpu clock cpu core clock symbol x2 ckcon.0 x2b hardware byte wdx2 ckcon.6 pcax2 ckcon.5 six2 ckcon.4 t2x2 ckcon.3 t1x2 ckcon.2 t0x2 ckcon.1 idl pcon.0 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 x2 ckcon.0 fwd clock fpca clock fuart clock ft2 clock ft1 clock ft0 clock and adc on reset
15 t89c5115 4128a?8051?04/02 figure 4. mode switching waveforms note: in order to prevent any incorrect operation while operating in the x2 mode, users must be aware that all peripherals using the clock frequency as a time reference (uart, timers...) will have their time reference divided by two. for example a free running timer generating an interrupt every 20 ms will then generate an interrupt every 10 ms. a uart with a 4800 baud rate will have a 9600 baud rate. xtal2 xtal1 cpu clock x2 bit x2 mode std mode std mode
16 t89c5115 4128a?8051?04/02 register table 12. ckcon register ckcon (s:8fh) clock control register notes: 1. this control bit is validated when the cpu clock bit x2 is set; when x2 is low, this bit has no effect. reset value = x000 0000b 76543210 ? wdx2 pcax2 six2 t2x2 t1x2 t0x2 x2 bit number bit mnemonic description 7- reserved the value read from this bit is indeterminate. do not set this bit. 6wdx2 watchdog clock (1) clear to select 6 clock periods per peripheral clock cycle. set to select 12 clock periods per peripheral clock cycle. 5 pcax2 programmable counter array clock (1) clear to select 6 clock periods per peripheral clock cycle. set to select 12 clock periods per peripheral clock cycle. 4six2 enhanced uart clock (mode 0 and 2) (1) clear to select 6 clock periods per peripheral clock cycle. set to select 12 clock periods per peripheral clock cycle. 3t2x2 timer2 clock (1) clear to select 6 clock periods per peripheral clock cycle. set to select 12 clock periods per peripheral clock cycle. 2t1x2 timer1 clock (1) clear to select 6 clock periods per peripheral clock cycle. set to select 12 clock periods per peripheral clock cycle. 1t0x2 timer0 clock (1) clear to select 6 clock periods per peripheral clock cycle. set to select 12 clock periods per peripheral clock cycle. 0x2 cpu clock clear to select 12 clock periods per machine cycle (std mode) for cpu and all the peripherals. set to select 6 clock periods per machine cycle (x2 mode) and to enable the individual peripherals "x2"bits.
17 t89c5115 4128a?8051?04/02 power management introduction two power reduction modes are implemented in the t89c5115: the idle mode and the power-down mode. these modes are detailed in the following sections. in addition to these power reduction modes, the clocks of the core and peripherals can be dynamically divided by 2 using the x2 mode detailed in section ?clock?. reset a reset is required after applying power at turn-on. to achieve a valid reset, the reset signal must be maintained for at least 2 machine cycles (24 oscillator clock periods) while the oscillator is running and stabilized and vcc established within the specified operating ranges. a device reset initializes the t89c5115 and vectors the cpu to address 0000h. rst input has a pull-down resistor allowing power-on reset by simply connecting an external capacitor to v dd as shown in figure 5. resistor value and input characteristics are discussed in the section ?dc characteristics? of the t89c5115 datasheet. the status of the port pins during reset is detailed in table 13. figure 5. reset circuitry and power-on reset table 13. pin conditions in special operating modes reset recommendation to prevent flash corruption a bad reset sequence will lead to bad microcontroller initialization and system registers like sfr?s, program counter, etc. will not be correctly initialized. a bad initialization may lead to unpredictable behaviour of the c51 microcontroller. an example of this situation may occur in an instance where the bit enboot in auxr1 register is initialized from the hardware bit bljb upon reset. since this bit allows map- ping of the bootloader in the code area, a reset failure can be critical. if one wants the enboot cleared inorder to unmap the boot from the code area (yet due to a bad reset) the bit enboot in sfr?s may be set. if the value of program counter is accidently in the range of the boot memory addresses then a flash access (write or erase) may corrupt the flash on-chip memory . it is recommended to use an external reset circuitry featuring power supply monitoring to prevent system malfunction during periods of insufficient power supply voltage(power supply failure, power supply switched off). mode port 1 port 2 port 3 port 4 reset high high high high idle data data data data power-down datadatadatadata rst r rst vss to cpu core and peripherals rst vdd + b. power-on reset a. rst input circuitry
18 t89c5115 4128a?8051?04/02 idle mode idle mode is a power reduction mode that reduces the power consumption. in this mode, program execution halts. idle mode freezes the clock to the cpu at known states while the peripherals continue to be clocked. the cpu status before entering idle mode is preserved, i.e., the program counter and program status word register retain their data for the duration of idle mode. the contents of the sfrs and ram are also retained. the status of the port pins during idle mode is detailed in table 13. entering idle mode to enter idle mode, set the idl bit in pcon register (see table 14). the t89c5115 enters idle mode upon execution of the instruction that sets idl bit. the instruction that sets idl bit is the last instruction executed. note: if idl bit and pd bit are set simultaneously, the t89c5115 enters power-down mode. then it does not go in idle mode when exiting power-down mode. exiting idle mode there are two ways to exit idle mode: 1. generate an enabled interrupt. ? hardware clears idl bit in pcon register which restores the clock to the cpu. execution resumes with the interrupt service routine. upon completion of the interrupt service routine, program execution resumes with the instruction immediately following the instruction that activated idle mode. the general-purpose flags (gf1 and gf0 in pcon register) may be used to indicate whether an interrupt occurred during normal operation or during idle mode. when idle mode is exited by an interrupt, the interrupt service routine may examine gf1 and gf0. 2. generate a reset. ? a logic high on the rst pin clears idl bit in pcon register directly and asynchronously. this restores the clock to the cpu. program execution momentarily resumes with the instruction immediately following the instruction that activated the idle mode and may continue for a number of clock cycles before the internal reset algorithm takes control. reset initializes the t89c5115 and vectors the cpu to address c:0000h. note: during the time that execution resumes, the internal ram cannot be accessed; however, it is possible for the port pins to be accessed. to avoid unexpected outputs at the port pins, the instruction immediately following the instruction that activated idle mode should notwritetoaportpinortotheexternalram. power-down mode the power-down mode places the t89c5115 in a very low power state. power-down mode stops the oscillator, freezes all clock at known states. the cpu status prior to entering power-down mode is preserved, i.e., the program counter, program status word register retain their data for the duration of power-down mode. in addition, the sfrs and ram contents are preserved. the status of the port pins during power-down mode is detailed in table 13. note: vddmaybereducedtoaslowasv ret during power-down mode to further reduce power dissipation. take care, however, that vdd is not reduced until power-down mode is invoked. entering power-down mode to enter power-down mode, set pd bit in pcon register. the t89c5115 enters the power-down mode upon execution of the instruction that sets pd bit. the instruction that sets pd bit is the last instruction executed.
19 t89c5115 4128a?8051?04/02 exiting power-down mode note: if vdd was reduced during the power-down mode, do not exit power-down mode until vdd is restored to the normal operating level. there are two ways to exit the power-down mode: 1. generate an enabled external interrupt. ? the t89c5115 provides capability to exit from power-down using int0#, int1#. hardware clears pd bit in pcon register which starts the oscillator and restores the clocks to the cpu and peripherals. using intx # input, execution resumes when the input is released (see figure 6). execution resumes with the interrupt service routine. upon completion of the interrupt service routine, program execution resumes with the instruction immediately following the instruction that activated power-down mode. notes: 1. the external interrupt used to exit power-down mode must be configured as level sensitive (int0# and int1#) and must be assigned the highest priority. in addition, the duration of the interrupt must be long enough to allow the oscillator to stabilize. the execution will only resume when the interrupt is deasserted. 2. exit from power-down by external interrupt does not affect the sfrs nor the internal ram content. figure 6. power-down exit waveform using int1:0# 2. generate a reset. ? a logic high on the rst pin clears pd bit in pcon register directly and asynchronously. this starts the oscillator and restores the clock to the cpu and peripherals. program execution momentarily resumes with the instruction immediately following the instruction that activated power-down mode and may continue for a number of clock cycles before the internal reset algorithm takes control. reset initializes the t89c5115 and vectors the cpu to address 0000h. notes: 1. during the time that execution resumes, the internal ram cannot be accessed; how- ever, it is possible for the port pins to be accessed. to avoid unexpected outputs at the port pins, the instruction immediately following the instruction that activated the power-down mode should not write to a port pin or to the external ram. 2. exit from power-down by reset redefines all the sfrs , but does not affect the internal ram content. int1:0# osc power-down phase oscillator restart phase active phase active phase
20 t89c5115 4128a?8051?04/02 registers pcon (s:87h) table 14. pcon register power configuration register reset value = xxxx 0000b 76543210 ????gf1gf0pdidl bit number bit mnemonic description 7-4 ? reserved the value read from these bits is indeterminate. do not set these bits. 3gf1 general-purpose flag 1 one use is to indicate whether an interrupt occurred during normal operation or during idle mode. 2gf0 general-purpose flag 0 one use is to indicate whether an interrupt occurred during normal operation or during idle mode. 1pd power-down mode bit cleared by hardware when an interrupt or reset occurs. set to activate the power-down mode. if idl and pd are both set, pd takes precedence. 0idl idle mode bit cleared by hardware when an interrupt or reset occurs. set to activate the idle mode. if idl and pd are both set, pd takes precedence.
21 t89c5115 4128a?8051?04/02 data memory the t89c5115 provides data memory access in two different spaces: the internal space mapped in three separate segments:  the lower 128 bytes ram segment.  the upper 128 bytes ram segment.  the expanded 256 bytes ram segment (eram). a fourth internal segment is available but dedicated to special function registers, sfrs, (addresses 80h to ffh) accessible by direct addressing mode. figure 7 shows the internal data memory spaces organization. figure 7. internal memory ? ram internal space lower 128 bytes ram the lower 128 bytes of ram (see figure 7) are accessible from address 00h to 7fh using direct or indirect addressing modes. the lowest 32 bytes are grouped into 4 banks of 8 registers (r0 to r7). two bits rs0 and rs1 in psw register (see figure 16) select which bank is in use according to table . this allows more efficient use of code space, since register instructions are shorter than instructions that use direct addressing, and can be used for context switching in interrupt service routines. the next 16 bytes above the register banks form a block of bit-addressable memory space. the c51 instruction set includes a wide selection of single-bit instructions, and the 128 bits in this area can be directly addressed by these instructions. the bit addresses in this area are 00h to 7fh. 256 bytes upper 128 bytes internal ram lower 128 bytes internal ram special function registers 80h 80h 00h ffh ffh 00h ffh direct addressing addressing 7fh internal eram direct or indirect indirect addressing table 15. register bank selection rs1 rs0 description 0 0 register bank 0 from 00h to 07h 0 1 register bank 0 from 08h to 0fh 1 0 register bank 0 from 10h to 17h 1 1 register bank 0 from 18h to 1fh
22 t89c5115 4128a?8051?04/02 figure 8. lower 128 bytes internal ram organization upper 128 bytes ram the upper 128 bytes of ram are accessible from address 80h to ffh using only indirect addressing mode. expanded ram the on-chip 256 bytes of expanded ram (eram) are accessible from address 0000h to 00ffh using indirect addressing mode through movx instructions. in this address range. note: lower 128 bytes ram, upper 128 bytes ram, and expanded ram are made of volatile memory cells. this means that the ram content is indeterminate after power-up and must then be initialized properly. bit-addressable space 4banksof 8registers r0-r7 30h 7fh (bit addresses 0-7fh) 20h 2fh 18h 1fh 10h 17h 08h 0fh 00h 07h
23 t89c5115 4128a?8051?04/02 dual data pointer description the t89c5115 implements a second data pointer for speeding up code execution and reducing code size in case of intensive usage of external memory accesses. dptr0 and dptr1 are seen by the cpu as dptr and are accessed using the sfr addresses 83h and 84h that are the dph and dpl addresses. the dps bit in auxr1 register (see figure 17) is used to select whether dptr is the data pointer 0 or the data pointer 1 (see figure 9). figure 9. dual data pointer implementation application software can take advantage of the additional data pointers to both increase speed and reduce code size, for example, block operations (copy, compare?) are well served by using one data pointer as a ?source? pointer and the other one as a ?destination? pointer. hereafter is an example of block move implementation using the two pointers and coded in assembler. the latest c compiler takes also advantage of this feature by providing enhanced algorithm libraries. the inc instruction is a short (2 bytes) and fast (6 machine cycle) way to manipulate the dps bit in the auxr1 register. however, note that the inc instruction does not directly force the dps bit to a particular state, but simply toggles it. in simple routines, such as the block move example, only the fact that dps is toggled in the proper sequence mat- ters, not its actual value. in other words, the block move routine works the same whether dps is '0' or '1' on entry. ; ascii block move using dual data pointers ; modifies dptr0, dptr1, a and psw ; ends when encountering null character ; note: dps exits opposite to the entry state unless an extra inc auxr1 is added auxr1equ0a2h move:movdptr,#source ; address of source incauxr1 ; switch data pointers movdptr,#dest ; address of dest mv_loop:incauxr1; switch data pointers movxa,@dptr; get a byte from source incdptr; increment source address incauxr1; switch data pointers movx@dptr,a; write the byte to dest incdptr; increment dest address jnzmv_loop; check for null terminator end_move: 0 1 dph0 dph1 dpl0 0 1 dps auxr1.0 dph dpl dpl1 dptr dptr0 dptr1
24 t89c5115 4128a?8051?04/02 registers table 16. psw register psw (s:8eh) program status word register reset value = 0000 0000b 76543210 cy ac f0 rs1 rs0 ov f1 p bit number bit mnemonic description 7cy carry flag carry out from bit 1 of alu operands. 6ac auxiliary carry flag carry out from bit 1 of addition operands. 5f0 user definable flag 0 4-3 rs1:0 register bank select bits refer to table for bits description. 2ov overflow flag overflow set by arithmetic operations. 1f1 user definable flag 1 0p parity bit set when acc contains an odd number of 1?s. cleared when acc contains an even number of 1?s.
25 t89c5115 4128a?8051?04/02 table 17. auxr1 register auxr1 (s:a2h) auxiliary control register 1 reset value = xxxx 00x0b 76543210 ? ? enboot ? gf3 0 ? dps bit number bit mnemonic description 7-6 ? reserved the value read from these bits is indeterminate. do not set these bits. 5 enboot enable boot flash set this bit for map the boot flash between f800h -ffffh clear this bit for disable boot flash. 4 ? reserved the value read from this bit is indeterminate. do not set this bit. 3gf3 general-purpose flag 3. 20 always zero this bit is stuck to logic 0 to allow inc auxr1 instruction without affecting gf3 flag. 1 ? reserved for data pointer extension. 0dps data pointer select bit set to select second dual data pointer: dptr1. clear to select first dual data pointer: dptr0.
26 t89c5115 4128a?8051?04/02 eeprom data memory the 2-kbyte on-chip eeprom memory block is located at addresses 0000h to 07ffh of the xram/eram memory space and is selected by setting control bits in the eecon register. a read in the eeprom memory is done with a movx instruction. a physical write in the eeprom memory is done in two steps: write data in the column latches and transfer of all data latches into an eeprom memory row (programming). the number of data written on the page may vary from 1 up to 128 bytes (the page size). when programming, only the data written in the column latch is programmed and a ninth bit is used to obtain this feature. this provides the capability to program the whole memory by bytes, by page or by a number of bytes in a page. indeed, each ninth bit is set when the writing the corresponding byte in a row and all these ninth bits are reset after the writing of the complete eeprom row. write data in the column latches data is written by byte to the column latches as for an external ram memory. out of the 11 address bits of the data pointer, the 4 msbs are used for page selection (row) and 7 are used for byte selection. between two eeprom programming sessions, all the addresses in the column latches must stay on the same page, meaning that the 4 msb must no be changed. the following procedure is used to write to the column latches:  save and disable interrupt.  set bit eee of eecon register  load dptr with the address to write  store a register with the data to be written  execute a movx @dptr, a  if needed loop the three last instructions until the end of a 128 bytes page  restore interrupt. note: the last page address used when loading the column latch is the one used to select the page programming address. programming the eeprom programming consists of the following actions:  writing one or more bytes of one page in the column latches. normally, all bytes must belong to the same page; if not, the first page address will be latched and the others discarded.  launching programming by writing the control sequence (50h followed by a0h) to the eecon register.  eebusy flag in eecon is then set by hardware to indicate that programming is in progress and that the eeprom segment is not available for reading.  the end of programming is indicated by a hardware clear of the eebusy flag. note: the sequence 5xh and axh must be executed without instructions between them, other- wise the programming is aborted. read data the following procedure is used to read the data stored in the eeprom memory:  save and disable interrupt  set bit eee of eecon register  load dptr with the address to read  execute a movx a, @dptr  restore interrupt
27 t89c5115 4128a?8051?04/02 examples ;*f************************************************************************* ;* name: api_rd_eeprom_byte ;* dptr contain address to read. ;* acc contain the reading value ;* note: before execute this function, be sure the eeprom is not busy ;*************************************************************************** api_rd_eeprom_byte: mov eecon, #02h; map eeprom in xram space movx a, @dptr mov eecon, #00h; unmap eeprom ret ;*f************************************************************************* ;* name: api_ld_eeprom_cl ;* dptr contain address to load ;* acc contain value to load ;* note: in this example we load only 1 byte, but it is possible upto ;* 128 bytes. ;* before execute this function, be sure the eeprom is not busy ;*************************************************************************** api_ld_eeprom_cl: mov eecon, #02h ; map eeprom in xram space movx @dptr, a moveecon, #00h; unmap eeprom ret ;*f************************************************************************* ;* name: api_wr_eeprom ;* note: before execute this function, be sure the eeprom is not busy ;*************************************************************************** api_wr_eeprom: mov eecon, #050h mov eecon, #0a0h ret
28 t89c5115 4128a?8051?04/02 registers table 18. eecon register eecon (s:0d2h) eeprom control register reset value = xxxx xx00b not bit addressable 76543210 eepl3 eepl2 eepl1 eepl0 - - eee eebusy bit number bit mnemonic description 7-4 eepl3-0 programming launch command bits write 5xh followed by axh to eepl to launch the programming. 3- reserved the value read from this bit is indeterminate. do not set this bit. 2- reserved the value read from this bit is indeterminate. do not set this bit. 1 eee enable eeprom space bit settomaptheeepromspaceduringmovxinstructions(writeinthecolumn latches). clear to map the xram space during movx. 0 eebusy programming busy flag set by hardware when programming is in progress. cleared by hardware when programming is done. can not be set or cleared by software.
29 t89c5115 4128a?8051?04/02 program/code memory the t89c5115 implement 16-kb of on-chip program/code memory. the flash memory increases eprom and rom functionality by in-circuit electrical era- sure and programming. thanks to the internal charge pump, the high voltage needed for programming or erasing flash cells is generated on-chip using the standard vdd volt- age. thus, the flash memory can be programmed using only one voltage and allows in- system programming commonly known as isp. hardware programming mode is also available using specific programming tool. figure 10. program/code memory organization flash memory architecture t89c5115 features two on-chip flash memories:  flash memory fm0: containing 16-kb of program memory (user space) organized into pages 128 bytes  flash memory fm1: 2k bytes for boot loader and application programming interfaces (api). the fm0 can be program by both parallel programming and serial in-system program- ming (isp) whereas fm1 supports only parallel programming by programmers. the isp mode is detailed in the "in-system programming" section. all read/write access operations on flash memory by user application are managed by a set of api described in the "in-system programming" section. figure 11. flash memory architecture 0000h 16-kb 3fffh internal flash 3fffh 16-kb flash memory fm0 0000h hardware security (1 byte) column latches (128 bytes) user space extra row (128 bytes) 2k bytes flash memory fm1 boot space ffffh f800h fm1 mapped between ffffh and f800h when bit enboot is set in auxr1 register
30 t89c5115 4128a?8051?04/02 fm0 memory architecture the flash memory is made up of 4 blocks (see figure 11): 1. the memory array (user space) 16-kb. 2. the extra row. 3. the hardware security bits. 4. the column latch registers. user space this space is composed of a 16-kb flash memory organized in 128 pages of 128 bytes. it contains the user?s application code. extra row (xrow) this row is a part of fm0 and has a size of 128 bytes. the extra row may contain infor- mation for boot loader usage. hardware security byte the hardware security byte space is a part of fm0 and has a size of 1 byte. the 4 msb can be read/written by software, the 4 lsb can only be read by software and written by hardware in parallel mode. column latches the column latches, also part of fm0, have a size of full page (128 bytes). the column latches are the entrance buffers of the three previous memory locations (user array, xrow and hardware security byte). cross flash memory access description the fm0 memory can be program only from fm1. programming fm0 from fm0 or from external memory is impossible. the fm1 memory can be program only by parallel programming. the table 19 show all software flash access allowed. table 19. cross flash memory access code executing from action fm0 (user flash) fm1 (boot flash) fm0 (user flash) read ok - load column latch ok - write - - fm1 (boot flash) read ok ok load column latch ok - write ok -
31 t89c5115 4128a?8051?04/02 overview of fm0 operations the cpu interfaces to the flash memory through the fcon register and auxr1 register. these registers are used to:  map the memory spaces in the adressable space  launch the programming of the memory spaces  get the status of the flash memory (busy/not busy) mapping of the memory space by default, the user space is accessed by movc instruction for read only. the column latches space is made accessible by setting the fps bit in fcon register. writing is possible from 0000h to 3fffh, address bits 6 to 0 are used to select an address within a page while bits 14 to 7 are used to select the programming address of the page. setting fps bit takes precedence on the eee bit in eecon register. the other memory spaces (user, extra row, hardware security) are made accessible in the code segment by programming bits fmod0 and fmod1 in fcon register in accor- dance with table 20. a movc instruction is then used for reading these spaces. table 20. fm0 blocks select bits launching programming fpl3:0 bits in fcon register are used to secure the launch of programming. a specific sequence must be written in these bits to unlock the write protection and to launch the programming. this sequence is 5xh followed by axh. table 21 summarizes the memory spaces to program according to fmod1:0 bits. table 21. programming spaces note: the sequence 5xh and axh must be executing without instructions between them other- wise the programming is aborted. fmod1 fmod0 fm0 adressable space 0 0 user (0000h-3fffh) 0 1 extra row(ff80h-ffffh) 1 0 hardware security byte (0000h) 11reserved write to fcon operation fpl3:0 fps fmod1 fmod0 user 5 x 0 0 no action ax0 0 write the column latches in user space extra row 5 x 0 1 no action ax0 1 write the column latches in extra row space hardware security byte 5 x 1 0 no action a x 1 0 write the fuse bits space reserved 5 x 1 1 no action a x 1 1 no action
32 t89c5115 4128a?8051?04/02 interrupts that may occur during programming time must be disabled to avoid any spuri- ous exit of the programming mode. status of the flash memory the bit fbusy in fcon register is used to indicate the status of programming. fbusy is set when programming is in progress. selecting fm1 the bit enboot in auxr1 register is used to map fm1 from f800h to ffffh. loading the column latches any number of data from 1 byte to 128 bytes can be loaded in the column latches. this provides the capability to program the whole memory by byte, by page or by any number of bytes in a page. when programming is launched, an automatic erase of the locations loaded in the col- umn latches is first performed, then programming is effectively done. thus no page or block erase is needed and only the loaded data are programmed in the corresponding page. the following procedure is used to load the column latches and is summarized in figure 12:  disable interrupt and map the column latch space by setting fps bit.  load the dptr with the address to load.  load accumulator register with the data to load.  execute the movx @dptr, a instruction.  if needed loop the three last instructions until the page is completely loaded.  unmap the column latch and enable interrupt
33 t89c5115 4128a?8051?04/02 figure 12. column latches loading procedure note: the last page address used when loading the column latch is the one used to select the page programming address. programming the flash spaces user the following procedure is used to program the user space and is summarized in figure 13:  load up to one page of data in the column latches from address 0000h to 3fffh.  disable the interrupts.  launch the programming by writing the data sequence 50h followed by a0h in fcon register (only from fm1). the end of the programming indicated by the fbusy flag cleared.  enable the interrupts. extra row the following procedure is used to program the extra row space and is summarized in figure 13:  load data in the column latches from address ff80h to ffffh.  disable the interrupts.  launch the programming by writing the data sequence 52h followed by a2h in fcon register (only from fm1). the end of the programming indicated by the fbusy flag cleared.  enable the interrupts. column latches loading data load dptr= address acc= data exec:movx@dptr,a last byte to load? column latches mapping fcon = 08h (fps=1) data memory mapping fcon = 00h (fps = 0) save & disable it ea= 0 restore it
34 t89c5115 4128a?8051?04/02 figure 13. flash and extra row programming procedure hardware security byte the following procedure is used to program the hardware security byte space and is summarized in figure 14:  set fps and map hardware byte (fcon = 0x0c)  save and disable the interrupts.  load dptr at address 0000h.  load accumulator register with the data to load.  execute the movx @dptr, a instruction.  launch the programming by writing the data sequence 54h followed by a4h in fcon register (only from fm1). the end of the programming indicated by the fbusy flag cleared.  restore the interrupts flash spaces programming save & disable it ea= 0 launch programming fcon= 5xh fcon= axh end programming restore it column latches loading see figure 12 fbusy cleared? clear mode fcon = 00h
35 t89c5115 4128a?8051?04/02 figure 14. hardware programming procedure reading the flash spaces user the following procedure is used to read the user space:  read one byte in accumulator by executing movc a,@a+dptr with a+dptr=read@. note: fcon is supposed to be reset when not needed. extra row the following procedure is used to read the extra row space and is summarized in figure 15:  map the extra row space by writing 02h in fcon register.  read one byte in accumulator by executing movc a,@a+dptr with a= 0 & dptr= ff80h to ffffh.  clear fcon to unmap the extra row. hardware security byte the following procedure is used to read the hardware security space and is summarized in figure 15:  map the hardware security space by writing 04h in fcon register.  read the byte in accumulator by executing movc a,@a+dptr with a= 0 & dptr= 0000h.  clear fcon to unmap the hardware security byte. flash spaces programming save & disable it ea= 0 launch programming fcon= 54h fcon= a4h end programming restoreit fbusy cleared? clear mode fcon = 00h data load dptr= 00h acc= data exec:movx@dptr,a fcon = 0ch save & disable it ea= 0 end loading restore it
36 t89c5115 4128a?8051?04/02 figure 15. reading procedure flash protection from parallel programming the three lock bits in hardware security byte (see "in-system programming" section) are programmed according to table 22 provide different level of protection for the on- chip code and data located in fm0 and fm1. the only way to write this bits are the parallel mode. they are set by default to level 3. table 22. program lock bit program lock bits u: unprogrammed p: programmed warning: security level 2 and 3 should only be programmed after flash and core verification. preventing flash corruption see paragraph in the "power management" section, page 17. flash spaces reading flash spaces mapping fcon= 00000xx0b data read dptr= address acc= 0 exec:movca,@a+dptr clear mode fcon = 00h program lock bits protection description security level lb0 lb1 lb2 1uuu no program lock features enabled. movc instruction executed from external program memory returns non encrypted data. 2 p u u parallel programming of the flash is disabled. 3upu same as 2, also verify through parallel programming interface is disabled.
37 t89c5115 4128a?8051?04/02 registers fcon register fcon (s:d1h) flash control register reset value = 0000 0000b 76543210 fpl3 fpl2 fpl1 fpl0 fps fmod1 fmod0 fbusy bit number bit mnemonic description 7-4 fpl3:0 programming launch command bits write 5xh followed by axh to launch the programming according to fmod1:0. (see table 21.) 3fps flash map program space set to map the column latch space in the data memory space. clear to re-map the data memory space. 2-1 fmod1:0 flash mode see table 20 or table 21. 0 fbusy flash busy set by hardware when programming is in progress. clear by hardware when programming is done. can not be changed by software.
38 t89c5115 4128a?8051?04/02 in-system programming (isp) with the implementation of the user space (fm0) and the boot space (fm1) in flash technology the t89c5115 allows the system engineer the development of applications with a very high level of flexibility. this flexibility is based on the possibility to alter the customer program at any stages of a product?s life:  before assembly the 1st personalization of the product by programming in the fm0 and if needed also a customized boot loader in the fm1. atmel provide also a standard boot loader by default uart  after assembling on the pcb in its final embedded position by serial mode via the uart. this in-system programming (isp) allows code modification over the total lifetime of the product. besides the default boot loader atmel provide to the customer also all the needed appli- cation-programming-interfaces (api) which are needed for the isp. the api are located also in the boot memory. this allow the customer to have a full use of the 16-kbyte user memory. flash programming and erasure there are three methods of programming the flash memory:  the atmel bootloader located in fm1 is activated by the application. low level api routines (located in fm1)will be used to program fm0. the interface used for serial downloading to fm0 is the uart. api can be called also by user?s bootloader located in fm0 at [sbv]00h.  a further method exist in activating the atmel boot loader by hardware activation.  the fm0 can be programmed also by the parallel mode using a programmer. figure 16. flash memory mapping f800h 3fffh 16-kb flash memory 2k bytes iap bootloader fm0 fm1 custom boot loader [sbv]00h ffffh fm1 mapped between f800h and ffffh when api called 0000h
39 t89c5115 4128a?8051?04/02 boot process software boot process example many algorithms can be used for the software boot process. before describing them, the description of the different flags and bytes is given below: boot loader jump bit (bljb): - this bit indicates if on reset the user wants to jump to this application at address @0000h on fm0 or execute the boot loader at address @f800h on fm1. - bljb = 0 on parts delivered with bootloader programmed. - to read or modify this bit, the apis are used. boot vector address (sbv): - this byte contains the msb of the user boot loader address in fm0. - the default value of sbv is ffh (no user boot loader in fm0). - to read or modify this byte, the apis are used. extra byte (eb) & boot status byte (bsb): - these bytes are reserved for customer use. - to read or modify these bytes, the apis are used. figure 17. hardware boot process algorithm reset bljb == 0 ? hardware software boot loader in fm1 application in fm0 bit enboot in auxr1 register is initialized with bljb. enboot = 0 pc = 0000h enboot = 1 pc = f800h
40 t89c5115 4128a?8051?04/02 application programming interface several application program interface (api) calls are available for use by an application program to permit selective erasing and programming of flash pages. all calls are made by functions. all apis are describe in: "in-system programing: flash library for t89c5115", available on the atmel web site at www.atmel.com. table 23. list of api xrow bytes table 24. xrow mapping api call description program data byte write a byte in flash memory program data page write a page (128 bytes) in flash memory program eeprom byte write a byte in eeprom memory erase block erase all flash memory erase boot vector (sbv) erase the boot vector program boot vector (sbv) write the boot vector program extra byte (eb) write the extra byte read data byte ? read eeprom byte ? read family code ? read manufacturer code ? read product name ? read revision number ? read status bit (bsb) read the status bit read boot vector (sbv) read the boot vector read extra byte (eb) read the extra byte program x2 write the hardware flag for x2 mode read x2 read the hardware flag for x2 mode start bootloader to start the bootloader from the application mnemonic description default value address ? copy of the manufacturer code 58h 30h ? copy of the device id#1: family code d7h 31h ? copy of the device id#2: memories size and type bbh 60h ? copy of the device id#3: name and revision ffh 61h
41 t89c5115 4128a?8051?04/02 hardware security byte table 25. hardware security byte default value after erasing chip: ffh notes: 1. only the 4 msb bits can be accessed by software. 2. the 4 lsb bits can only be accessed by parallel mode. 76543210 x2b bljb - - - lb2 lb1 lb0 bit number bit mnemonic description 7x2b x2 bit set this bit to start in standard mode clear this bit to start in x2 mode. 6bljb boot loader jump bit - 1: to start the user?s application on next reset (@0000h) located in fm0, - 0: to start the boot loader(@f800h) located in fm1. 5-3 - reserved the value read from these bits are indeterminate. 2-0 lb2:0 lock bits
42 t89c5115 4128a?8051?04/02 serial i/o port the t89c5115 i/o serial port is compatible with the i/o serial port in the 80c52. it provides both synchronous and asynchronous communication modes. it operates as a universal asynchronous receiver and transmitter (uart) in three full-duplex modes (modes 1, 2 and 3). asynchronous transmission and reception can occur simultaneously and at different baud rates serial i/o port includes the following enhancements:  framing error detection  automatic address recognition figure 18. serial i/o port block diagram framing error detection framing bit error detection is provided for the three asynchronous modes. to enable the framing bit error detection feature, set smod0 bit in pcon register. figure 19. framing error block diagram when this feature is enabled, the receiver checks each incoming data frame for a valid stop bit. an invalid stop bit may result from noise on the serial lines or from simultaneous transmission by two cpus. if a valid stop bit is not found, the framing error bit (fe) in scon register bit is set. the software may examine the fe bit after each reception to check for data errors. once set, only software or a reset clears the fe bit. subsequently received frames with write sbuf ri ti sbuf transmitter sbuf receiver ib bus mode 0 transmit receive shift register load sbuf read sbuf interrupt request serial port txd rxd ri ti rb8 tb8 ren sm2 sm1 sm0/fe idl pd gf0 gf1 pof - smod0 smod1 to uart framing error control sm0touartmodecontrol set fe bit if stop bit is 0 (framing error)
43 t89c5115 4128a?8051?04/02 valid stop bits cannot clear the fe bit. when the fe feature is enabled, ri rises on the stop bit instead of the last data bit (see figure 20 and figure 21). figure 20. uart timing in mode 1 figure 21. uart timing in modes 2 and 3 automatic address recognition the automatic address recognition feature is enabled when the multiprocessor commu- nication feature is enabled (sm2 bit in scon register is set). implemented in the hardware, automatic address recognition enhances the multiproces- sor communication feature by allowing the serial port to examine the address of each incoming command frame. only when the serial port recognizes its own address will the receiver set the ri bit in the scon register to generate an interrupt. this ensures that the cpu is not interrupted by command frames addressed to other devices. if necessary, you can enable the automatic address recognition feature in mode 1. in this configuration, the stop bit takes the place of the ninth data bit. bit ri is set only when the received command frame address matches the device?s address and is terminated by a valid stop bit. to support automatic address recognition, a device is identified by a given address and a broadcast address. note: the multiprocessor communication and automatic address recognition features cannot be enabled in mode 0 (i.e. setting sm2 bit in scon register in mode 0 has no effect). data byte ri smod0=x stop bit start bit rxd d7 d6 d5 d4 d3 d2 d1 d0 fe smod0=1 ri smod0=0 data byte ninth bit stop bit start bit rxd d8 d7 d6 d5 d4 d3 d2 d1 d0 ri smod0=1 fe smod0=1
44 t89c5115 4128a?8051?04/02 given address each device has an individual address that is specified in the saddr register; the saden register is a mask byte that contains don?t-care bits (defined by zeros) to form the device?s given address. the don?t-care bits provide the flexibility to address one or more slaves at a time. the following example illustrates how a given address is formed. to address a device by its individual address, the saden mask byte must be 1111 1111b . for example: saddr0101 0110b saden 1111 1100b given0101 01xxb here is an example of how to use given addresses to address different slaves: slave a:saddr1111 0001b saden 1111 1010b given1111 0x0xb slave b:saddr1111 0011b saden 1111 1001b given1111 0xx1b slave c:saddr1111 0010b saden 1111 1101b given1111 00x1b the saden byte is selected so that each slave may be addressed separately. for slave a, bit 0 (the lsb) is a don?t-care bit; for slaves b and c, bit 0 is a 1. to com- municate with slave a only, the master must send an address where bit 0 is clear (e.g. 1111 0000b ). for slave a, bit 1 is a 0; for slaves b and c, bit 1 is a don?t care bit. to communicate with slaves a and b, but not slave c, the master must send an address with bits 0 and 1 both set (e.g. 1111 0011b ). to communicate with slaves a, b and c, the master must send an address with bit 0 set, bit 1 clear, and bit 2 clear (e.g. 1111 0001b ). broadcast address a broadcast address is formed from the logical or of the saddr and saden registers with zeros defined as don?t-care bits, e.g.: saddr 0101 0110b saden 1111 1100b saddr or saden1111 111xb the use of don?t-care bits provides flexibility in defining the broadcast address, however in most applications, a broadcast address is ffh. the following is an example of using broadcast addresses: slave a:saddr1111 0001b saden 1111 1010b given1111 1x11b, slave b:saddr1111 0011b saden 1111 1001b given1111 1x11b, slave c:saddr=1111 0010b saden 1111 1101b given1111 1111b
45 t89c5115 4128a?8051?04/02 for slaves a and b, bit 2 is a don?t care bit; for slave c, bit 2 is set. to communicate with all of the slaves, the master must send an address ffh. to communicate with slaves a and b, but not slave c, the master can send and address fbh. registers table 26. scon register scon (s:98h) serial control register reset value = 0000 0000b bit addressable 76543210 fe/sm0 sm1 sm2 ren tb8 rb8 ti ri bit number bit mnemonic description 7fe framing error bit (smod0 = 1 ) cleartoresettheerrorstate,notclearedbyavalidstopbit. set by hardware when an invalid stop bit is detected. ?sm0 serial port mode bit 0 (smod0 = 0) refer to sm1 for serial port mode selection. 6sm1 serial port mode bit 1 sm0 sm1 mode baud rate 0 0 shift register f xtal /12 (or f xtal /6 in mode x2) 0 1 8-bit uart variable 1 0 9-bit uart f xtal /64 or f xtal /32 1 1 9-bit uart variable 5sm2 serial port mode 2 bit/multiprocessor communication enable bit clear to disable multiprocessor communication feature. set to enable multiprocessor communication feature in mode 2 and 3. 4ren reception enable bit clear to disable serial reception. set to enable serial reception. 3tb8 transmitter bit 8/ninth bit to transmit in modes 2 and 3 clear to transmit a logic 0 in the 9th bit. set to transmit a logic 1 in the 9th bit. 2rb8 receiver bit 8/ninth bit received in modes 2 and 3 cleared by hardware if 9th bit received is a logic 0. set by hardware if 9th bit received is a logic 1. 1ti transmit interrupt flag clear to acknowledge interrupt. set by hardware at the end of the 8th bit time in mode 0 or at the beginning of the stop bit in the other modes. 0ri receive interrupt flag clear to acknowledge interrupt. set by hardware at the end of the 8th bit time in mode 0, see figure 20 and figure 21 in the other modes.
46 t89c5115 4128a?8051?04/02 table 27. saden register saden (s:b9h) slave address mask register reset value = 0000 0000b not bit addressable table 28. saddr register saddr (s:a9h) slave address register reset value = 0000 0000b not bit addressable table 29. sbuf register sbuf (s:99h) serial data buffer reset value = 0000 0000b not bit addressable 76543210 bit number bit mnemonic description 7-0 ? mask data for slave individual address 76543210 bit number bit mnemonic description 7-0 ? slave individual address 76543210 ???????? bit number bit mnemonic description 7-0 ? data sent/received by serial i/o port
47 t89c5115 4128a?8051?04/02 table 30. pcon register pcon (s:87h) power control register reset value = 00x1 0000b not bit addressable 76543210 smod1 smod0 - pof gf1 gf0 pd idl bit number bit mnemonic description 7smod1 serial port mode bit 1 settoselectdoublebaudrateinmode1,2or3. 6smod0 serial port mode bit 0 clear to select sm0 bit in scon register. set to select fe bit in scon register. 5- reserved the value read from this bit is indeterminate. do not set this bit. 4pof power-off flag clear to recognize next reset type. set by hardware when vcc rises from 0 to its nominal voltage. can also be set by software. 3gf1 general-purpose flag cleared by user for general-purpose usage. set by user for general-purpose usage. 2gf0 general-purpose flag cleared by user for general-purpose usage. set by user for general-purpose usage. 1pd power-down mode bit cleared by hardware when reset occurs. set to enter power-down mode. 0idl idle mode bit clear by hardware when interrupt or reset occurs. set to enter idle mode.
48 t89c5115 4128a?8051?04/02 timers/counters the t89c5115 implements two general-purpose, 16-bit timers/counters. such are identified as timer 0 and timer 1, and can be independently configured to operate in a variety of modes as a timer or an event counter. when operating as a timer, the timer/counter runs for a programmed length of time, then issues an interrupt request. when operating as a counter, the timer/counter counts negative transitions on an external pin. after a preset number of counts, the counter issues an interrupt request. the various operating modes of each timer/counter are described in the following sections. timer/counter operations a basic operation is timer registers thx and tlx (x= 0, 1) connected in cascade to form a 16-bit timer. setting the run control bit (trx) in tcon register (see figure 31) turns the timer on by allowing the selected input to increment tlx. when tlx overflows it increments thx; when thx overflows it sets the timer overflow flag (tfx) in tcon reg- ister. setting the trx does not clear the thx and tlx timer registers. timer registers can be accessed to obtain the current count or to enter preset values. they can be read at any time but trx bit must be cleared to preset their values, otherwise the behavior of the timer/counter is unpredictable. the c/tx# control bit selects timer operation or counter operation by selecting the divided-down peripheral clock or external pin tx as the source for the counted signal. trx bit must be cleared when changing the mode of operation, otherwise the behavior of the timer/counter is unpredictable. for timer operation (c/tx#= 0), the timer register counts the divided-down peripheral clock. the timer register is incremented once every peripheral cycle (6 peripheral clock periods). the timer clock rate is f per /6, i.e. f osc /12 in standard mode or f osc /6 in x2 mode. for counter operation (c/tx#= 1), the timer register counts the negative transitions on the tx external input pin. the external input is sampled every peripheral cycles. when the sample is high in one cycle and low in the next one, the counter is incremented. since it takes 2 cycles (12 peripheral clock periods) to recognize a negative transition, the maximum count rate is f per /12, i.e. f osc /24 in standard mode or f osc /12 in x2 mode. there are no restrictions on the duty cycle of the external input signal, but to ensure that a given level is sampled at least once before it changes, it should be held for at least one full peripheral cycle. timer 0 timer 0 functions as either a timer or event counter in four modes of operation. figure 22 to figure 25 show the logical configuration of each mode. timer 0 is controlled by the four lower bits of tmod register (see figure 32) and bits 0, 1, 4 and 5 of tcon register (see figure 31). tmod register selects the method of timer gating (gate0), timer or counter operation (t/c0#) and mode of operation (m10 and m00). tcon register provides timer 0 control functions: overflow flag (tf0), run control bit (tr0), interrupt flag (ie0) and interrupt type control bit (it0). for normal timer operation (gate0= 0), setting tr0 allows tl0 to be incremented by the selected input. setting gate0 and tr0 allows external pin int0# to control timer operation. timer 0 overflow (count rolls over from all 1s to all 0s) sets tf0 flag generating an inter- rupt request. it is important to stop timer/counter before changing mode.
49 t89c5115 4128a?8051?04/02 mode 0 (13-bit timer) mode 0 configures timer 0 as an 13-bit timer which is set up as an 8-bit timer (th0 register) with a modulo 32 prescaler implemented with the lower five bits of tl0 register (see figure 22). the upper three bits of tl0 register are indeterminate and should be ignored. prescaler overflow increments th0 register. figure 22. timer/counter x (x= 0 or 1) in mode 0 mode 1 (16-bit timer) mode 1 configures timer 0 as a 16-bit timer with th0 and tl0 registers connected in cascade (see figure 23). the selected input increments tl0 register. figure 23. timer/counter x (x= 0 or 1) in mode 1 ftx clock trx tcon reg tfx tcon reg 0 1 gatex tmod reg 6 overflow timer x interrupt request c/tx# tmod reg tlx (5 bits) thx (8 bits) intx# tx see the ?clock? section trx tcon reg tfx tcon reg 0 1 gatex tmod reg overflow timer x interrupt request c/tx# tmod reg tlx (8 bits) thx (8 bits) intx# tx ftx clock 6 see the ?clock? section
50 t89c5115 4128a?8051?04/02 mode 2 (8-bit timer with auto- reload) mode 2 configures timer 0 as an 8-bit timer (tl0 register) that automatically reloads from th0 register (see figure 24). tl0 overflow sets tf0 flag in tcon register and reloads tl0 with the contents of th0, which is preset by software. when the interrupt request is serviced, hardware clears tf0. the reload leaves th0 unchanged. the next reload value may be changed at any time by writing it to th0 register. figure 24. timer/counter x (x= 0 or 1) in mode 2 mode3(two8-bittimers) mode 3 configures timer 0 such that registers tl0 and th0 operate as separate 8-bit timers (see figure 25). this mode is provided for applications requiring an additional 8- bit timer or counter. tl0 uses the timer 0 control bits c/t0# and gate0 in tmod reg- ister, and tr0 and tf0 in tcon register in the normal manner. th0 is locked into a timer function (counting f per /6) and takes over use of the timer 1 interrupt (tf1) and run control (tr1) bits. thus, operation of timer 1 is restricted when timer 0 is in mode 3. figure 25. timer/counter 0 in mode 3: two 8-bit counters trx tcon reg tfx tcon reg 0 1 gatex tmod reg overflow timer x interrupt request c/tx# tmod reg tlx (8 bits) thx (8 bits) intx# tx ftx clock 6 see section ?clock? tr0 tcon.4 tf0 tcon.5 int0# 0 1 gate0 tmod.3 overflow timer 0 interrupt request c/t0# tmod.2 tl0 (8 bits) tr1 tcon.6 th0 (8 bits) tf1 tcon.7 overflow timer 1 interrupt request t0 ftx clock 6 ftx clock 6 see section ?clock?
51 t89c5115 4128a?8051?04/02 timer 1 timer 1 is identical to timer 0 excepted for mode 3 which is a hold-count mode. follow- ing comments help to understand the differences:  timer 1 functions as either a timer or event counter in three modes of operation. figure 22 to figure 24 show the logical configuration for modes 0, 1, and 2. timer 1?s mode 3 is a hold-count mode.  timer 1 is controlled by the four high-order bits of tmod register (see figure 32) and bits 2, 3, 6 and 7 of tcon register (see figure 31). tmod register selects the method of timer gating (gate1), timer or counter operation (c/t1#) and mode of operation (m11 and m01). tcon register provides timer 1 control functions: overflow flag (tf1), run control bit (tr1), interrupt flag (ie1) and interrupt type control bit (it1).  timer 1 can serve as the baud rate generator for the serial port. mode 2 is best suited for this purpose.  for normal timer operation (gate1= 0), setting tr1 allows tl1 to be incremented by the selected input. setting gate1 and tr1 allows external pin int1# to control timer operation.  timer 1 overflow (count rolls over from all 1s to all 0s) sets the tf1 flag generating an interrupt request.  when timer 0 is in mode 3, it uses timer 1?s overflow flag (tf1) and run control bit (tr1). for this situation, use timer 1 only for applications that do not require an interrupt (such as a baud rate generator for the serial port) and switch timer 1 in and out of mode 3 to turn it off and on.  it is important to stop timer/counter before changing mode. mode 0 (13-bit timer) mode 0 configures timer 1 as a 13-bit timer, which is set up as an 8-bit timer (th1 reg- ister) with a modulo-32 prescaler implemented with the lower 5 bits of the tl1 register (see figure 22). the upper 3 bits of tl1 register are ignored. prescaler overflow incre- ments th1 register. mode 1 (16-bit timer) mode 1 configures timer 1 as a 16-bit timer with th1 and tl1 registers connected in cascade (see figure 23). the selected input increments tl1 register. mode 2 (8-bit timer with auto- reload) mode 2 configures timer 1 as an 8-bit timer (tl1 register) with automatic reload from th1 register on overflow (see figure 24). tl1 overflow sets tf1 flag in tcon register and reloads tl1 with the contents of th1, which is preset by software. the reload leaves th1 unchanged. mode3(halt) placing timer 1 in mode 3 causes it to halt and hold its count. this can be used to halt timer 1 when tr1 run control bit is not available i.e. when timer 0 is in mode 3.
52 t89c5115 4128a?8051?04/02 interrupt each timer handles one interrupt source that is the timer overflow flag tf0 or tf1. this flag is set every time an overflow occurs. flags are cleared when vectoring to the timer interrupt routine. interrupts are enabled by setting etx bit in ien0 register. this assumes interrupts are globally enabled by setting ea bit in ien0 register. figure 26. timer interrupt system tf0 tcon.5 et0 ien0.1 timer 0 interrupt request tf1 tcon.7 et1 ien0.3 timer 1 interrupt request
53 t89c5115 4128a?8051?04/02 registers table 31. tcon register tcon (s:88h) timer/counter control register reset value = 0000 0000b 76543210 tf1 tr1 tf0 tr0 ie1 it1 ie0 it0 bit number bit mnemonic description 7tf1 timer 1 overflow flag cleared by hardware when processor vectors to interrupt routine. set by hardware on timer/counter overflow, when timer 1 register overflows. 6tr1 timer 1 run control bit clear to turn off timer/counter 1. settoturnontimer/counter1. 5tf0 timer 0 overflow flag cleared by hardware when processor vectors to interrupt routine. set by hardware on timer/counter overflow, when timer 0 register overflows. 4tr0 timer 0 run control bit clear to turn off timer/counter 0. settoturnontimer/counter0. 3ie1 interrupt 1 edge flag cleared by hardware when interrupt is processed if edge-triggered (see it1). set by hardware when external interrupt is detected on int1# pin. 2it1 interrupt 1 type control bit clear to select low level active (level triggered) for external interrupt 1 (int1#). set to select falling edge active (edge triggered) for external interrupt 1. 1ie0 interrupt 0 edge flag cleared by hardware when interrupt is processed if edge-triggered (see it0). set by hardware when external interrupt is detected on int0# pin. 0it0 interrupt 0 type control bit clear to select low level active (level triggered) for external interrupt 0 (int0#). set to select falling edge active (edge triggered) for external interrupt 0.
54 t89c5115 4128a?8051?04/02 table 32. tmod register tmod (s:89h) timer/counter mode control register notes: 1. reloaded from th1 at overflow. 2. reloaded from th0 at overflow. reset value = 0000 0000b 76543210 gate1 c/t1# m11 m01 gate0 c/t0# m10 m00 bit number bit mnemonic description 7gate1 timer 1 gating control bit clear to enable timer 1 whenever tr1 bit is set. set to enable timer 1 only while int1# pin is high and tr1 bit is set. 6c/t1# timer 1 counter/timer select bit clear for timer operation: timer 1 counts the divided-down system clock. set for counter operation: timer 1 counts negative transitions on external pin t1. 5m11 timer 1 mode select bits m11 m01 operating mode 0 0 mode 0: 8-bit timer/counter (th1) with 5-bit prescaler (tl1). 0 1 mode 1: 16-bit timer/counter. 1 1 mode 3: timer 1 halted. retains count. 1 0 mode 2: 8-bit auto-reload timer/counter (tl1). (1) 4m01 3gate0 timer 0 gating control bit clear to enable timer 0 whenever tr0 bit is set. set to enable timer/counter 0 only while int0# pin is high and tr0 bit is set. 2c/t0# timer 0 counter/timer select bit clear for timer operation: timer 0 counts the divided-down system clock. set for counter operation: timer 0 counts negative transitions on external pin t0. 1m10 timer 0 mode select bit m10 m00 operating mode 0 0 mode 0: 8-bit timer/counter (th0) with 5-bit prescaler (tl0). 0 1 mode 1: 16-bit timer/counter. 1 0 mode 2: 8-bit auto-reload timer/counter (tl0). (2) 1 1 mode3:tl0isan8-bittimer/counter. th0isan8-bittimerusingtimer1?str0andtf0bits. 0m00
55 t89c5115 4128a?8051?04/02 table 33. th0 register th0 (s:8ch) timer 0 high byte register reset value = 0000 0000b table 34. tl0 register tl0 (s:8ah) timer 0 low byte register reset value = 0000 0000b table 35. th1 register th1 (s:8dh) timer 1 high byte register reset value = 0000 0000b 76543210 bit number bit mnemonic description 7:0 high byte of timer 0. 76543210 bit number bit mnemonic description 7:0 low byte of timer 0. 76543210 bit number bit mnemonic description 7:0 high byte of timer 1.
56 t89c5115 4128a?8051?04/02 table 36. tl1 register tl1 (s:8bh) timer 1 low byte register reset value = 0000 0000b 76543210 bit number bit mnemonic description 7:0 low byte of timer 1.
57 t89c5115 4128a?8051?04/02 timer 2 the t89c5115 timer 2 is compatible with timer 2 in the 80c52. it is a 16-bit timer/counter: the count is maintained by two eight-bit timer registers, th2 and tl2 that are cascade- connected. it is controlled by t2con register (see table ) and t2mod register (see table 39). timer 2 operation is similar to timer 0 and timer 1. c/t2 selects f t2 clock /6 (timer operation) or external pin t2 (counter operation) as timer clock. setting tr2 allows tl2 to be incremented by the selected input. timer 2 includes the following enhancements:  auto-reload mode (up or down counter)  programmable clock-output auto-reload mode the auto-reload mode configures timer 2 as a 16-bit timer or event counter with auto- matic reload. this feature is controlled by the dcen bit in t2mod register (see table 39). setting the dcen bit enables timer 2 to count up or down as shown in figure 27. in this mode the t2ex pin controls the counting direction. when t2ex is high, timer 2 counts up. timer overflow occurs at ffffh which sets the tf2 flag and generates an interrupt request. the overflow also causes the 16-bit value in rcap2h and rcap2l registers to be loaded into the timer registers th2 and tl2. when t2ex is low, timer 2 counts down. timer underflow occurs when the count in the timer registers th2 and tl2 equals the value stored in rcap2h and rcap2l registers. the underflow sets tf2 flag and reloads ffffh into the timer registers. the exf2 bit toggles when timer 2 overflow or underflow, depending on the direction of the count. exf2 does not generate an interrupt. this bit can be used to provide 17-bit resolution. figure 27. auto-reload mode up/down counter (down counting reload value) tf2 t2 exf2 th2 (8-bit) tl2 ( 8-bit) rcap2h (8-bit) rcap2l (8-bit) ffh (8-bit) ffh ( 8-bit) toggle (up counting reload value) timer 2 interrupt :6 t2conreg t2conreg t2ex: 1=up 2=down 0 1 ct/2 t2con.1 tr2 t2con.2 ft2 clock see section ?clock?
58 t89c5115 4128a?8051?04/02 programmable clock- output in clock-out mode, timer 2 operates as a 50%-duty-cycle, programmable clock genera- tor (see figure 28). the input clock increments tl2 at frequency f osc /2. the timer repeatedly counts to overflow from a loaded value. at overflow, the contents of rcap2h and rcap2l registers are loaded into th2 and tl2. in this mode, timer 2 overflows do not generate interrupts. the formula gives the clock-out frequency depending on the system osc illator frequency and the value in the rcap2h and rcap2l registers: for a 16 mhz system clock in x1 mode, timer 2 has a programmable frequency range of 61 hz (f osc /2 16) to 4 mhz (f osc /4). the generated clock signal is brought out to t2 pin (p1.0). timer 2 is programmed for the clock-out mode as follows:  set t2oe bit in t2mod register.  clear c/t2 bit in t2con register.  determine the 16-bit reload value from the formula and enter it in rcap2h/rcap2l registers.  enter a 16-bit initial value in timer registers th2/tl2. it can be the same as the reload value or different depending on the application.  to start the timer, set tr2 run control bit in t2con register. it is possible to use timer 2 as a baud rate generator and a clock generator simulta- neously. for this configuration, the baud rates and clock frequencies are not independent since both functions use the values in the rcap2h and rcap2l registers. figure 28. clock-out mode clock outfrequency ? ft 2 clock 4 65536 rcap 2 h ? rcap 2 l ? () ------------------------------------------------------------------------------------------- - = :2 exen2 exf2 overflow t2ex th2 (8-bit) tl2 (8-bit) timer 2 rcap2h (8-bit) rcap2l (8-bit) t2oe t2 t2con reg t2con reg t2mod reg 1 0 c/t2 t2con reg interrupt 0 1 ct/2 t2con.1 tr2 t2con.2 ft2 clock
59 t89c5115 4128a?8051?04/02 registers table 37. t2con register t2con (s:c8h) timer 2 control register reset value = 0000 0000b bit addressable 76543210 tf2 exf2 rclk tclk exen2 tr2 c/t2# cp/rl2# bit number bit mnemonic description 7tf2 timer 2 overflow flag tf2 is not set if rclk=1 or tclk = 1. must be cleared by software. set by hardware on timer 2 overflow. 6exf2 timer 2 external flag set when a capture or a reload is caused by a negative transition on t2ex pin if exen2=1. set to cause the cpu to vector to timer 2 interrupt routine when timer 2 interrupt is enabled. must be cleared by software. 5rclk receive clock bit clear to use timer 1 overflow as receive clock for serial port in mode 1 or 3. set to use timer 2 overflow as receive clock for serial port in mode 1 or 3. 4tclk transmit clock bit clear to use timer 1 overflow as transmit clock for serial port in mode 1 or 3. set to use timer 2 overflow as transmit clock for serial port in mode 1 or 3. 3 exen2 timer 2 external enable bit clear to ignore events on t2ex pin for timer 2 operation. settocauseacaptureorreloadwhenanegativetransitionont2expinis detected, if timer 2 is not used to clock the serial port. 2tr2 timer 2 run control bit clear to turn off timer 2. settoturnontimer2. 1c/t2# timer/counter 2 select bit clear for timer operation (input from internal clock system: f osc ). set for counter operation (input from t2 input pin). 0cp/rl2# timer 2 capture/reload bit if rclk=1 or tclk=1, cp/rl2# is ignored and timer is forced to auto-reload on timer 2 overflow. clear to auto-reload on timer 2 overflows or negative transitions on t2ex pin if exen2=1. set to capture on negative transitions on t2ex pin if exen2=1.
60 t89c5115 4128a?8051?04/02 table 38. t2mod register t2mod (s:c9h) timer 2 mode control register reset value = xxxx xx00b not bit addressable table 39. th2 register th2 (s:cdh) timer 2 high byte register reset value = 0000 0000b not bit addressable 76543210 ------t2oedcen bit number bit mnemonic description 7- reserved the value read from this bit is indeterminate. do not set this bit. 6- reserved the value read from this bit is indeterminate. do not set this bit. 5- reserved the value read from this bit is indeterminate. do not set this bit. 4- reserved the value read from this bit is indeterminate. do not set this bit. 3- reserved the value read from this bit is indeterminate. do not set this bit. 2- reserved the value read from this bit is indeterminate. do not set this bit. 1t2oe timer 2 output enable bit clear to program p1.0/t2 as clock input or i/o port. set to program p1.0/t2 as clock output. 0 dcen down counter enable bit clear to disable timer 2 as up/down counter. set to enable timer 2 as up/down counter. 76543210 -------- bit number bit mnemonic description 7-0 highbyteoftimer2.
61 t89c5115 4128a?8051?04/02 table 40. tl2 register tl2 (s:cch) timer 2 low byte register reset value = 0000 0000b not bit addressable table 41. rcap2h register rcap2h (s:cbh) timer 2 reload/capture high byte register reset value = 0000 0000b not bit addressable table 42. rcap2l register rcap2l (s:ca h ) timer 2 reload/capture low byte register reset value = 0000 0000b not bit addressable 76543210 -------- bit number bit mnemonic description 7-0 low byte of timer 2. 76543210 -------- bit number bit mnemonic description 7-0 high byte of timer 2 reload/capture. 76543210 -------- bit number bit mnemonic description 7-0 low byte of timer 2 reload/capture.
62 t89c5115 4128a?8051?04/02 watchdog timer t89c5115 contains a powerful programmable hardware watchdog timer (wdt) that automatically resets the chip if it software fails to reset the wdt before the selected time interval has elapsed. it permits large time-out ranking from 16ms to 2s @fosc = 12 mhz in x1 mode. this wdt consists of a 14-bit counter plus a 7-bit programmable counter, a watchdog timer reset register (wdtrst) and a watchdog timer programming (wdtprg) regis- ter. when exiting reset, the wdt is -by default- disable. to enable the wdt, the user has to write the sequence 1eh and e1h into wdtrst register no instruction in between. when the watchdog timer is enabled, it will incre- ment every machine cycle while the oscillator is running and there is no way to disable the wdt except through reset (either hardware reset or wdt overflow reset). when wdt overflows, it will generate an output reset pulse at the rst pin. the reset pulse duration is 96xt osc ,wheret osc =1/f osc . to make the best use of the wdt, it should be serviced in those sections of code that will periodically be executed within the time required to prevent a wdt reset. note: when the watchdog is enable it is impossible to change its period. figure 29. watchdog timer 6 ps cpu and peripheral clock fwd clock wdtprg reset decoder control wdtrst wr enable 14-bit counter 7-bit counter outputs fwd clock reset - - - - - 2 1 0
63 t89c5115 4128a?8051?04/02 watchdog programming the three lower bits (s0, s1, s2) located into wdtprg register permit to program the wdt duration. table 43. machine cycle count to compute wd time-out, the following formula is applied: note: svalue represents the decimal value of (s2 s1 s0) the following table indicates the computed time-out value for fosc xtal =12mhzinx1 mode table 44. time-out computation s2 s1 s0 machine cycle count 000 2 14 -1 001 2 15 -1 010 2 16 -1 011 2 17 -1 100 2 18 -1 101 2 19 -1 110 2 20 -1 111 2 21 -1 s2 s1 s0 fosc = 12 mhz fosc = 16 mhz fosc = 20 mhz 0 0 0 16.38 ms 12.28 ms 9.82 ms 0 0 1 32.77 ms 24.57 ms 19.66 ms 0 1 0 65.54 ms 49.14 ms 39.32 ms 0 1 1 131.07 ms 98.28 ms 78.64 ms 1 0 0 262.14ms 196.56ms 157.28ms 1 0 1 524.29ms 393.12ms 314.56ms 1 1 0 1.05sec 786.24ms 629.12ms 1 1 1 2.10 sec 1.57 s 1.25 ms ftime out f wd 12 2 14 2 svalue () 1 ? () ------------------------------------------------------------------ - = ?
64 t89c5115 4128a?8051?04/02 watchdog timer during power-down mode and idle in power-down mode the oscillator stops, which means the wdt also stops. while in power-down mode, the user does not need to service the wdt. there are 2 methods of exiting power-down mode: by a hardware reset or via a level activated external interrupt which is enabled prior to entering power-down mode. when power-down is exited with hardware reset, the watchdog is disabled. exiting power-down with an interrupt is sig- nificantly different. the interrupt shall be held low long enough for the oscillator to stabilize. when the interrupt is brought high, the interrupt is serviced. to prevent the wdt from resetting the device while the interrupt pin is held low, the wdt is not started until the interrupt is pulled high. it is suggested that the wdt be reset during the inter- rupt service for the interrupt used to exit power-down. to ensure that the wdt does not overflow within a few states of exiting powerdown, it is best to reset the wdt just before entering powerdown. in the idle mode, the oscillator continues to run. to prevent the wdt from resetting t89c5115 while in idle mode, the user should always set up a timer that will periodically exit idle, service the wdt, and re-enter idle mode. register table 45. wdtprg register wdtprg (s:a7h) watchdog timer duration programming register reset value = xxxx x000b 76543210 - - - - - s2 s1 s0 bit number bit mnemonic description 7- reserved the value read from this bit is indeterminate. do not set this bit. 6- reserved the value read from this bit is indeterminate. do not set this bit. 5- reserved the value read from this bit is indeterminate. do not set this bit. 4- reserved the value read from this bit is indeterminate. do not set this bit. 3- reserved the value read from this bit is indeterminate. do not set this bit. 2s2 watchdog timer duration selection bit 2 work in conjunction with bit 1 and bit 0. 1s1 watchdog timer duration selection bit 1 work in conjunction with bit 2 and bit 0. 0s0 watchdog timer duration selection bit 0 work in conjunction with bit 1 and bit 2.
65 t89c5115 4128a?8051?04/02 table 46. wdtrst register wdtrst (s:a6h write only) watchdog timer enable register reset value = 1111 1111b note: the wdrst register is used to reset/enable the wdt by writing 1eh then e1h in sequence without instruction between these two sequences. 76543210 -------- bit number bit mnemonic description 7 - watchdog control value
66 t89c5115 4128a?8051?04/02 programmable counter array (pca) the pca provides more timing capabilities with less cpu intervention than the standard timer/counters. its advantages include reduced software overhead and improved accu- racy. the pca consists of a dedicated timer/counter which serves as the time base for an array of five compare/capture modules. its clock input can be programmed to count any of the following signals:  pca clock frequency/6 (see ?clock? section)  pca clock frequency/2 timer0overflow  external input on eci (p1.2) each compare/capture modules can be programmed in any one of the following modes:  rising and/or falling edge capture,  software timer,  high-speed output,  pulse width modulator. when the compare/capture modules are programmed in capture mode, software timer, or high speed output mode, an interrupt can be generated when the module executes its function. all five modules plus the pca timer overflow share one interrupt vector. the pca timer/counter and compare/capture modules share port 1 for external i/os. thesepinsarelistedbelow.iftheportisnotusedforthepca,itcanstillbeusedfor standard i/o. pca timer the pca timer is a common time base for all five modules (see figure 9). the timer count source is determined from the cps1 and cps0 bits in the cmod sfr (see table 8) and can be programmed to run at:  1/6 the pca clock frequency.  1/2 the pca clock frequency.  the timer 0 overflow.  the input on the eci pin (p1.2). pca component external i/o pin 16-bit counter p1.2/eci 16-bit module 0 p1.3/cex0 16-bit module 1 p1.4/cex1
67 t89c5115 4128a?8051?04/02 figure 30. pca timer/counter the cmod register includes three additional bits associated with the pca.  the cidl bit which allows the pca to stop during idle mode.  the wdte bit which enables or disables the watchdog function on module 4.  the ecf bit which when set causes an interrupt and the pca overflow flag cf in ccon register to be set when the pca timer overflows. the ccon register contains the run control bit for the pca and the flags for the pca timer and each module.  the cr bit must be set to run the pca. the pca is shut off by clearing this bit.  the cf bit is set when the pca counter overflows and an interrupt will be generated if the ecf bit in cmod register is set. the cf bit can only be cleared by software.  the ccf0:1 bits are the flags for the modules (ccf0 for module0...) and are set by hardware when either a match or a capture occurs. these flags also can be cleared by software. cidl cps1 cps0 ecf it ch cl 16 bit up/down counter to pca modules fpca/6 fpca/2 t0 ovf p1.2 idle cmod 0xd9 wdte cf cr ccon 0xd8 ccf1 ccf0 overflow
68 t89c5115 4128a?8051?04/02 pca modules each one of the five compare/capture modules has six possible functions. it can perform:  16-bit capture, positive-edge triggered  16-bit capture, negative-edge triggered  16-bit capture, both positive and negative-edge triggered  16-bit software timer  16-bit high speed output  8-bit pulse width modulator. each module in the pca has a special function register associated with it (ccapm0 for module 0 ...). the ccapm0:1 registers contain the bits that control the mode that each module will operate in.  the eccf bit enables the ccf flag in the ccon register to generate an interrupt when a match or compare occurs in the associated module.  the pwm bit enables the pulse width modulation mode.  the tog bit when set causes the cex output associated with the module to toggle when there is a match between the pca counter and the module?s capture/compare register.  the match bit mat when set will cause the ccfn bit in the ccon register to be set when there is a match between the pca counter and the module?s capture/compare register.  the two bits capn and capp in ccapmn register determine the edge that a capture input will be active on. the capn bit enables the negative edge, and the capp bit enables the positive edge. if both bits are set both edges will be enabled.  the bit ecom in ccapm register when set enables the comparator function.
69 t89c5115 4128a?8051?04/02 pca interrupt figure 31. pca interrupt system pca capture mode to use one of the pca modules in capture mode either one or both of the ccapm bits capn and capp for that module must be set. the external cex input for the module (on port 1) is sampled for a transition. when a valid transition occurs the pca hardware loads the value of the pca counter registers (ch and cl) into the module?s capture reg- isters (ccapnl and ccapnh). if the ccfn bit for the module in the ccon sfr and the eccfn bit in the ccapmn sfr are set then an interrupt will be generated. figure 32. pca capture mode cf cr ccon 0xd8 ccf1 ccf0 module 1 module 0 pca timer/counter to interrupt ec ien0.6 ea ien0.7 ecf cmod.0 eccfn ccapmn.0 cexn n=0,1 pca counter ch (8bits) cl (8bits) ccapnh ccapnl ccfn ccon reg pca interrupt request - 7 ccapmn register (n = 0, 1) 0 eccfn capnn000 0cappn
70 t89c5115 4128a?8051?04/02 16-bit software timer mode the pca modules can be used as software timers by setting both the ecom and mat bits in the modules ccapmn register. the pca timer will be compared to the module?s capture registers and when a match occurs an interrupt will occur if the ccfn (ccon sfr) and the eccfn (ccapmn sfr) bits for the module are both set. figure 33. pca 16-bit software timer and high speed output mode ccapnl (8 bits) ccapnh (8 bits) - ecomn0 0 matn togn0 eccfn 70 ccapmn register (n = 0, 1) ch (8 bits) cl (8 bits) 16-bit comparator match enable ccfn ccon reg pca interrupt request cexn compare/capture module pca counter ?0? ?1? reset write to ccapnl writetoccapnh for software timer mode, set ecomn and matn. for high speed output mode, set ecomn, matn and togn. toggle
71 t89c5115 4128a?8051?04/02 high speed output mode in this mode the cex output (on port 1) associated with the pca module will toggle each time a match occurs between the pca counter and the module?s capture registers. to activate this mode the tog, mat, and ecom bits in the module?s ccapmn sfr must be set. figure 34. pca high speed output mode pulse width modulator mode all the pca modules can be used as pwm outputs. the output frequency depends on the source for the pca timer. all the modules will have the same output frequency because they all share the pca timer. the duty cycle of each module is independently variable using the module?s capture register ccapln. when the value of the pca cl sfr is less than the value in the module?s ccapln sfr the output will be low, when it is equal to or greater than it, the output will be high. when cl overflows from ff to 00, ccapln is reloaded with the value in ccaphn. the allows the pwm to be updated with- out glitches. the pwm and ecom bits in the module?s ccapmn register must be set to enable the pwm mode. ch cl ccapnh ccapnl ecomn ccapmn,n=0to1 0xda to 0xde capnn matn togn pwmn eccfn cappn 16 bit comparator match cf cr ccon 0xd8 ccf1 ccf0 pca it enable cexn pca counter/timer ?1? ?0? write to ccapnl reset write to ccapnh
72 t89c5115 4128a?8051?04/02 figure 35. pca pwm mode cl rolls over from ffh to 00h loads ccapnh contents into ccapnl ccapnl ccapnh 8-bit comparator cl (8 bits) ?0? ?1? cl < ccapnl cl >= ccapnl cex pwmn ccapmn.1 ecomn ccapmn.6
73 t89c5115 4128a?8051?04/02 pca registers table 47. cmod register cmod (s:d9h) pca counter mode register reset value = 00xx x000b 76543210 cidl wdte - - - cps1 cps0 ecf bit number bit mnemonic description 7cidl pca counter idle control bit cleartoletthepcarunduringidlemode. settostopthepcawhenidlemodeisinvoked. 6wdte watchdog timer enable clear to disable watchdog timer function on pca module 4, set to enable it. 5- reserved the value read from this bit is indeterminate. do not set this bit. 4- reserved the value read from this bit is indeterminate. do not set this bit. 3- reserved the value read from this bit is indeterminate. do not set this bit. 2cps1 ewc count pulse select bits cps1 cps0 clock source 0 0 internal clock, fpca/6 0 1 internal clock, fpca/2 1 0 timer 0 overflow 1 1 external clock at eci/p1.2 pin (max. rate = fpca/4) 1cps0 0ecf enable pca counter overflow interrupt bit clear to disable cf bit in ccon register to generate an interrupt. set to enable cf bit in ccon register to generate an interrupt.
74 t89c5115 4128a?8051?04/02 table 48. ccon register ccon (s:d8h) pca counter control register reset value = 00xx xx00b 76543210 cf cr - - - - ccf1 ccf0 bit number bit mnemonic description 7cf pca timer/counter overflow flag set by hardware when the pca timer/counter rolls over. this generates a pca interrupt request if the ecf bit in cmod register is set. must be cleared by software. 6cr pca timer/counter run control bit clear to turn the pca timer/counter off. set to turn the pca timer/counter on. 5-2 - reserved the value read from these bist are indeterminate. do not set these bits. 1ccf1 pca module 1 compare/capture flag set by hardware when a match or capture occurs. this generates a pca interrupt request if the eccf 1 bit in ccapm 1 register is set. must be cleared by software. 0ccf0 pca module 0 compare/capture flag set by hardware when a match or capture occurs. this generates a pca interrupt request if the eccf 0 bit in ccapm 0 register is set. must be cleared by software.
75 t89c5115 4128a?8051?04/02 table 49. ccapnh registers ccap0h (s:fah) ccap1h (s:fbh) pca high byte compare/capture module n register (n=0..1) reset value = 0000 0000b table 50. ccapnl registers ccap0l (s:eah) ccap1l (s:ebh) pca low byte compare/capture module n register (n=0..1) reset value = 0000 0000b 76543210 ccapnh 7 ccapnh 6 ccapnh 5 ccapnh 4 ccapnh 3 ccapnh 2 ccapnh 1 ccapnh 0 bit number bit mnemonic description 7:0 ccapnh 7:0 high byte of ewc-pca comparison or capture values 76543210 ccapnl 7 ccapnl 6 ccapnl 5 ccapnl 4 ccapnl 3 ccapnl 2 ccapnl 1 ccapnl 0 bit number bit mnemonic description 7:0 ccapnl 7:0 low byte of ewc-pca comparison or capture values
76 t89c5115 4128a?8051?04/02 table 51. ccapmn registers ccapm0 (s:dah) ccapm1 (s:dbh) pca compare/capture module n mode registers (n=0..1) reset value = x000 0000b 76543210 - ecomn cappn capnn matn togn pwmn eccfn bit number bit mnemonic description 7- reserved the value read from this bit is indeterminate. do not set this bit. 6ecomn enable compare mode module x bit clear to disable the compare function. set to enable the compare function. the compare function is used to implement the software timer, the high-speed output, the pulse width modulator (pwm) and the watchdog timer (wdt). 5 cappn capture mode (positive) module x bit clear to disable the capture function triggered by a positive edge on cexx pin. set to enable the capture function triggered by a positive edge on cexx pin 4capnn capture mode (negative) module x bit clear to disable the capture function triggered by a negative edge on cexx pin. set to enable the capture function triggered by a negative edge on cexx pin. 3matn match module x bit set when a match of the pca counter with the compare/capture register sets ccfx bit in ccon register, flagging an interrupt. 2togn toggle module x bit the toggle mode is configured by setting ecomx, matx and togx bits. set when a match of the pca counter with the compare/capture register toggles the cexx pin. 1pwmn pulse width modulation module x mode bit set to configure the module x as an 8-bit pulse width modulator with output waveform on cexx pin. 0 eccfn enable ccfx interrupt bit clear to disable ccfx bit in ccon register to generate an interrupt request. set to enable ccfx bit in ccon register to generate an interrupt request.
77 t89c5115 4128a?8051?04/02 table 52. ch register ch (s:f9h) pca counter register high value reset value = 0000 00000b table 53. cl register cl (s:e9h) pca counter register low value reset value = 0000 00000b 76543210 ch 7 ch 6 ch 5 ch 4 ch 3 ch 2 ch 1 ch 0 bit number bit mnemonic description 7:0 ch 7:0 high byte of timer/counter 76543210 cl 7 cl 6 cl 5 cl 4 cl 3 cl 2 cl 1 cl 0 bit number bit mnemonic description 7:0 cl0 7:0 low byte of timer/counter
78 t89c5115 4128a?8051?04/02 analog-to-digital converter (adc) this section describes the on-chip 10-bit analog-to-digital converter of the t89c5115. eight adc channels are available for sampling of the external sources an0 to an7. an analog multiplexer allows the single adc converter to select one from the 8 adc chan- nels as adc input voltage (adcin). adcin is converted by the 10 bit-cascaded potentiometric adc. two kind of conversion are available: - standard conversion (8 bits). - precision conversion (10 bits). for the precision conversion, set bit psidle in adcon register and start conversion. the device is in a pseudo-idle mode, the cpu does not run but the peripherals are always running. this mode allows digital noise to be as low as possible, to ensure high precision conversion. for this mode it is necessary to work with end of conversion interrupt, which is the only way to wake the device up. if another interrupt occurs during the precision conversion, it will be treated only after this conversion is ended. features  8 channels with multiplexed inputs  10-bit cascaded potentiometric adc  conversion time 16 micro-seconds (typ.)  zero error (offset) 2 lsb max  positive external reference voltage range (vref) 2.4v to 3.0v (typ.)  adcin range 0v to 3v  integral non-linearity typical 1 lsb, max. 2 lsb  differential non-linearity typical 0.5 lsb, max. 1 lsb  conversion complete flag or conversion complete interrupt  selectable adc clock adc port1 i/o functions port 1 pins are general i/o that are shared with the adc channels. the channel select bit in adcf register define which adc channel/port1 pin will be used as adcin. the remaining adc channels/port1 pins can be used as general-purpose i/o or as the alter- nate function that is available. a conversion launched on a channel which are not selected on adcf register will not have any effect.
79 t89c5115 4128a?8051?04/02 figure 36. adc description figure 37 shows the timing diagram of a complete conversion. for simplicity, the figure depicts the waveforms in idealized form and do not provide precise timing information. for adc characteristics and timing parameters refer to the section ?ac characteristics? of the t89c5115 datasheet. figure 37. timing diagram note: tsetup min = 4 us tconv=11 clock adc = 1sample and hold + 10 bit conversion the user must ensure that 4 us minimum time between setting aden and the start of the first conversion. adc converter operation a start of single a/d conversion is triggered by setting bit adsst (adcon.3). after completion of the a/d conversion, the adsst bit is cleared by hardware. the end-of-conversion flag adeoc (adcon.4) is set when the value of conversion is available in addh and addl, it must be cleared by software. if the bit eadc (ien1.1) is set, an interrupt occur when flag adeoc is set (see figure 39). clear this flag for re- arming the interrupt. thebitssch0tosch2inadconregisterareusedfortheanaloginputchannel selection. an0/p1.0 an1/p1.1 an2/p1.2 an3/p1.3 an4/p1.4 an5/p1.5 an6/p1.6 an7/p1.7 000 001 010 011 100 101 110 111 sch2 adcon.2 sch0 adcon.0 sch1 adcon.1 adc clock aden adcon.5 adsst adcon.3 adeoc adcon.4 adc interrupt request eadc ien1.1 control avss sample and hold addh varef r/2r dac vagnd 8 10 + - addl 2 sar adcin aden adsst adeoc t setup t conv clk
80 t89c5115 4128a?8051?04/02 table 54. selected analog input voltage conversion when the adcin is equals to varef the adc converts the signal to 3ffh (full scale). if the input voltage equals vagnd, the adc converts it to 000h. input voltage between varef and vagnd are a straight-line linear conversion. all other voltages will result in 3ffh if greater than varef and 000h if less than vagnd. note that adcin should not exceed varef absolute maximum range! (see section ?ac-dc?) clock selection the adc clock is the same as cpu. the maximum clock frequency for adc is 700 khz. a prescaler is featured (adcclk) to generate the adc clock from the oscillator frequency. figure 38. a/d converter clock adc standby mode when the adc is not used, it is possible to set it in standby mode by clearing bit aden in adcon register. in this mode its power dissipation is about 1 uw. sch2 sch1 sch0 selected analog input 000an0 001an1 010an2 011an3 100an4 101an5 110an6 111an7 prescaler adclk a/d converter adc clock cpu clock cpu core clock symbol 2
81 t89c5115 4128a?8051?04/02 it adc management an interrupt end-of-conversion will occurs when the bit adeoc is activated and the bit eadc is set. for re-arming the interrupt the bit adeoc must be cleared by software. figure 39. adc interrupt structure routine examples 1. configure p1.2 and p1.3 in adc channels // configure channel p1.2 and p1.3 for adc adcf = 0ch // enable the adc adcon = 20h 2. start a standard conversion // the variable "channel" contains the channel to convert // the variable "value_converted" is an unsigned int // clear the field sch[2:0] adcon &= f8h // select channel adcon |= channel // start conversion in standard mode adcon |= 08h // wait flag end of conversion while((adcon & 01h)!= 01h) // clear the end of conversion flag adcon &= efh // read the value value_converted = (addh << 2)+(addl) 3. start a precision conversion (need interrupt adc) // the variable "channel" contains the channel to convert // enable adc eadc = 1 // clear the field sch[2:0] adcon &= f8h // select the channel adcon |= channel // start conversion in precision mode adcon |= 48h note: to enable the adc interrupt: ea = 1 adeoc adcon.2 eadc ien1.1 adci
82 t89c5115 4128a?8051?04/02 registers table 55. adcf register adcf (s:f6h) adc configuration reset value = 0000 0000b table 56. adcon register adcon (s:f3h) adc control register reset value = x000 0000b 76543210 ch 7 ch 6 ch 5 ch 4 ch 3 ch 2 ch 1 ch 0 bit number bit mnemonic description 7-0 ch 0:7 channel configuration set to use p1.x as adc input. clear to use p1.x as standart i/o port. 76543210 - psidle aden adeoc adsst sch2 sch1 sch0 bit number bit mnemonic description 7- 6 psidle pseudo idle mode (best precision) set to put in idle mode during conversion clear to convert without idle mode. 5aden enable/standby mode set to enable adc clear for standby mode (power dissipation 1 uw). 4adeoc end of conversion set by hardware when adc result is ready to be read. this flag can generate an interrupt. must be cleared by software. 3 adsst start and status set to start an a/d conversion. cleared by hardware after completion of the conversion 2-0 sch2:0 selection of channel to convert see table 54
83 t89c5115 4128a?8051?04/02 table 57. adclk register adclk (s:f2h) adc clock prescaler reset value = xxx0 0000b table 58. addh register addh (s:f5h read only) adc data high byte register reset value = 00h table 59. addl register addl (s:f4h read only) adc data low byte register reset value = 00h 76543210 - - - prs 4 prs 3 prs 2 prs 1 prs 0 bit number bit mnemonic description 7-5 - reserved the value read from these bits are indeterminate. do not set these bits. 4-0 prs4:0 clock prescaler f adc = fcpu clock/ (4 (or 2 in x2 mode)* (prs +1)) 76543210 adat 9 adat 8 adat 7 adat 6 adat 5 adat 4 adat 3 adat 2 bit number bit mnemonic description 7-0 adat9:2 adc result bits 9-2 76543210 - - - - - - adat 1 adat 0 bit number bit mnemonic description 7-2 - reserved the value read from these bits are indeterminate. do not set these bits. 1-0 adat1:0 adc result bits 1-0
84 t89c5115 4128a?8051?04/02 interrupt system introduction the t89c5115 has a total of 8 interrupt vectors: two external interrupts (int0 and int1 ), three timer interrupts (timers 0, 1 and 2), a serial port interrupt, a pcaand an adc. these interrupts are shown below. figure 40. interrupt control system each of the interrupt sources can be individually enabled or disabled by setting or clear- ing a bit in the interrupt enable register. this register also contains a global disable bit which must be cleared to disable all the interrupts at the same time. each interrupt source can also be individually programmed to one of four priority levels by setting or clearing a bit in the interrupt priority registers. the table below shows the bit values and priority levels associated with each combination. ex0 ien0.0 00 01 10 11 external interrupt 0 int0# ex1 ien0.2 external interrupt 1 int1# et0 ien0.1 timer 0 ec ien0.6 pca et1 ien0.3 timer 1 es ien0.4 uart interrupt enable lowest priority interrupts highest priority enable 00 01 10 11 00 01 10 11 00 01 10 11 00 01 10 11 00 01 10 11 priority interrupts ain1:0 iph/l timer 2 00 01 10 11 et2 ien0.5 txd rxd cex0:1 adc 00 01 10 11 eadc ien1.1 ea ien0.7
85 t89c5115 4128a?8051?04/02 table 60. priority level bit values a low-priority interrupt can be interrupted by a high priority interrupt but not by another low-priority interrupt. a high-priority interrupt cannot be interrupted by any other interrupt source. if two interrupt requests of different priority levels are received simultaneously, the request of the higher priority level is serviced. if interrupt requests of the same priority level are received simultaneously, an internal polling sequence determines which request is serviced. thus within each priority level there is a second priority structure determined by the polling sequence, see table 61. table 61. interrupt priority within level iph.x ipl.x interrupt level priority 0 0 0 (lowest) 011 102 1 1 3 (highest) interrupt name interrupt address vector priority number external interrupt (int0) 0003h 1 timer0 (tf0) 000bh 2 external interrupt (int1) 0013h 3 timer1 (tf1) 001bh 4 pca (cf or ccfn) 0033h 5 uart (ri or ti) 0023h 6 timer2 (tf2) 002bh 7 adc (adci) 0043h 8
86 t89c5115 4128a?8051?04/02 registers table 62. ien0 register ien0 (s:a8h) interrupt enable register reset value = 0000 0000b bit addressable 76543210 ea ec et2 es et1 ex1 et0 ex0 bit number bit mnemonic description 7ea enable all interrupt bit clear to disable all interrupts. set to enable all interrupts. if ea=1, each interrupt source is individually enabled or disabled by setting or clearing its interrupt enable bit. 6ec pca interrupt enable clear to disable the pca interrupt. set to enable the pca interrupt. 5et2 timer 2 overflow interrupt enable bit clear to disable timer 2 overflow interrupt. set to enable timer 2 overflow interrupt. 4es serial port enable bit clear to disable serial port interrupt. set to enable serial port interrupt. 3et1 timer 1 overflow interrupt enable bit clear to disable timer 1 overflow interrupt. set to enable timer 1 overflow interrupt. 2ex1 external interrupt 1 enable bit clear to disable external interrupt 1. set to enable external interrupt 1. 1et0 timer 0 overflow interrupt enable bit clear to disable timer 0 overflow interrupt. set to enable timer 0 overflow interrupt. 0ex0 external interrupt 0 enable bit clear to disable external interrupt 0. set to enable external interrupt 0.
87 t89c5115 4128a?8051?04/02 table 63. ien1 register ien1 (s:e8h) interrupt enable register reset value = xxxx xx0xb bit addressable 76543210 ------eadc- bit number bit mnemonic description 7- reserved the value read from this bit is indeterminate. do not set this bit. 6- reserved the value read from this bit is indeterminate. do not set this bit. 5- reserved the value read from this bit is indeterminate. do not set this bit. 4- reserved the value read from this bit is indeterminate. do not set this bit. 3- reserved the value read from this bit is indeterminate. do not set this bit. 2- reserved the value read from this bit is indeterminate. do not set this bit. 1 eadc adc interrupt enable bit clear to disable the adc interrupt. set to enable the adc interrupt. 0- reserved the value read from this bit is indeterminate. do not set this bit.
88 t89c5115 4128a?8051?04/02 table 64. ipl0 register ipl0 (s:b8h) interrupt enable register reset value = x000 0000b bit addressable 76543210 - ppc pt2 ps pt1 px1 pt0 px0 bit number bit mnemonic description 7- reserved the value read from this bit is indeterminate. do not set this bit. 6 ppc pca interrupt priority bit refer to ppch for priority level. 5pt2 timer 2 overflow interrupt priority bit refer to pt2h for priority level. 4ps serial port priority bit refertopshforprioritylevel. 3pt1 timer 1 overflow interrupt priority bit refer to pt1h for priority level. 2px1 external interrupt 1 priority bit refer to px1h for priority level. 1pt0 timer 0 overflow interrupt priority bit refer to pt0h for priority level. 0px0 external interrupt 0 priority bit refer to px0h for priority level.
89 t89c5115 4128a?8051?04/02 table 65. ipl1 register ipl1 (s:f8h) interrupt priority low register 1 reset value = xxxx xx0xb bit addressable 76543210 - - - - - - padcl - bit number bit mnemonic description 7- reserved the value read from this bit is indeterminate. do not set this bit. 6- reserved the value read from this bit is indeterminate. do not set this bit. 5- reserved the value read from this bit is indeterminate. do not set this bit. 4- reserved the value read from this bit is indeterminate. do not set this bit. 3- reserved the value read from this bit is indeterminate. do not set this bit. 2- reserved the value read from this bit is indeterminate. do not set this bit. 1 padcl adc interrupt priority level less significant bit. refer to pspih for priority level. 0- reserved the value read from this bit is indeterminate. do not set this bit.
90 t89c5115 4128a?8051?04/02 table 66. ipl0 register iph0 (b7h) interrupt high priority register reset value = x000 0000b 76543210 - ppch pt2h psh pt1h px1h pt0h px0h bit number bit mnemonic description 7- reserved the value read from this bit is indeterminate. do not set this bit. 6 ppch pca interrupt priority level most significant bit ppch ppc priority level 00 lowest 01 10 1 1 highest priority 5pt2h timer 2 overflow interrupt high priority bit pt2h pt2 priority level 00 lowest 01 10 1 1 highest 4 psh serial port high priority bit psh ps priority level 00 lowest 01 10 1 1 highest 3pt1h timer 1 overflow interrupt high priority bit pt1h pt1 priority level 00 lowest 01 10 1 1 highest 2px1h external interrupt 1 high priority bit px1h px1 priority level 00 lowest 01 10 1 1 highest 1pt0h timer 0 overflow interrupt high priority bit pt0h pt0 priority level 00 lowest 01 10 1 1 highest 0px0h external interrupt 0 high priority bit px0h px0 priority level 00 lowest 01 10 1 1 highest
91 t89c5115 4128a?8051?04/02 table 67. iph1 register iph1 (s:f7h) interrupt high priority register 1 reset value = xxxx xx0xb 76543210 - - - - - - padch - bit number bit mnemonic description 7- reserved the value read from this bit is indeterminate. do not set this bit. 6- reserved the value read from this bit is indeterminate. do not set this bit. 5- reserved the value read from this bit is indeterminate. do not set this bit. 4- reserved the value read from this bit is indeterminate. do not set this bit. 3- reserved the value read from this bit is indeterminate. do not set this bit. 2- reserved the value read from this bit is indeterminate. do not set this bit. 1 padch adc interrupt priority level most significant bit padch padcl priority level 00 lowest 01 10 1 1 highest 0- reserved the value read from this bit is indeterminate. do not set this bit.
92 t89c5115 4128a?8051?04/02 electrical characteristics absolute maximum ratings dc parameters for standard voltage t a =-40 cto+85 c; v ss =0v; v cc =5v 10%; f = 0 to 40 mhz notes: 1. operating i cc is measured with all output pins disconnected; xtal1 driven with t clch ,t chcl = 5 ns (see figure 44.), v il = v ss +0.5v,v ih =v cc - 0.5v; xtal2 n.c.; rst = v cc .i cc would be slightly higher if a crystal oscillator used (see figure 41.). 2. idle i cc is measured with all output pins disconnected; xtal1 driven with t clch ,t chcl =5ns,v il =v ss +0.5v,v ih =v cc - 0.5v; xtal2 n.c; port 0 = v cc ;rst=v ss (see figure 42.). 3. power-down i cc is measured with all output pins disconnected; xtal2 nc.; rst = v ss (see figure 43.). in addition, the wdt must be inactive and the pof flag must be set. 4. typicals are based on a limited number of samples and are not guaranteed. the values listed are at room temperature. ambiant temperature under bias: i = industrial ....................................................... -40 cto85 c storage temperature ................................... -65 cto+150 c voltageonv cc from v ss ......................................-0.5v to + 6v voltageonanypinfromv ss ....................-0.5v to v cc +0.2v power dissipation ............................................................. 1 w note: stresses at or above those listed under ?absolute maximum ratings? may cause permanent damage to the device. this is a stress rating only and functional operation of the device at these or any other condi- tions above those indicated in the operational sections of this specification is not implied. exposure to absolute maximum rating conditions may affect device reliability. the power dissipation is based on the maximum allowable die temperature and the thermal resistance of the package. table 68. dc parameters in standard voltage symbol parameter min typ (5) max unit test conditions v il input low voltage -0.5 0.2 vcc - 0.1 v v ih input high voltage except xtal1, rst 0.2 v cc +0.9 v cc +0.5 v v ih1 input high voltage, xtal1, rst 0.7 v cc v cc +0.5 v v ol output low voltage, ports 1, 2, 3 and 4 (6) 0.3 0.45 1.0 v v v i ol =100 a i ol =1.6ma i ol =3.5ma v oh output high voltage, ports 1, 2, 3, 4 v cc -0.3 v cc -0.7 v cc -1.5 v v v i oh =-10 a i oh =-30 a i oh =-60 a v cc =5v 10% r rst rst pulldown resistor 50 90 200 k ? i il logical 0 input current ports 1, 2, 3 and 4 -50 avin=0.45v i li input leakage current 10 a0.45v 93 t89c5115 4128a?8051?04/02 5. under steady state (non-transient) conditions, i ol must be externally limited as fol- lows: maximum i ol per port pin: 10 ma maximum i ol per 8-bit port: ports 1, 2 and 3: 15 ma maximum total i ol for all output pins: 71 ma if i ol exceeds the test condition, v ol may exceed the related specification. pins are not guaranteed to sink current greater than the listed test conditions. figure 41. i cc test condition, active mode figure 42. i cc test condition, idle mode figure 43. i cc test condition, power-down mode v cc i cc (nc) clock signal v cc all other pins are disconnected. rst xtal2 xtal1 v ss v cc rst xtal2 xtal1 v ss v cc i cc (nc) v cc all other pins are disconnected. clock signal rst xtal2 xtal1 v ss v cc i cc (nc) v cc all other pins are disconnected
94 t89c5115 4128a?8051?04/02 figure 44. clock signal waveform for i cc tests in active and idle modes dc parameters for a/d converter table 69. dc parameters for ad converter in precision conversion note: 1. typicals are based on a limited number of samples and are not guaranteed. v cc -0.5v 0.45v 0.7v cc 0.2v cc -0.1 t clch t chcl t clch =t chcl =5ns. symbol parameter min typ (1) max unit test conditions avin analog input voltage vss - 0.2 vref + 0.6 v rref resistance between vref and vss 12 16 24 k ? vref reference voltage 2.40 3.00 v cai analog input capacitance 60 pf during sampling inl integral non linearity 1 2 lsb dnl differential non linearity 0.5 1 lsb oe offset error -2 2 lsb
95 t89c5115 4128a?8051?04/02 ac parameters explanation of the ac symbols each timing symbol has 5 characters. the first character is always a ?t? (stands for time). the other characters, depending on their positions, stand for the name of a signal or the logical status of that signal. the following is a list of all the characters and what they stand for. example: t avll = time for address valid to ale low. t llpl = time for ale low to psen low. t a =-40 cto+85 c; v ss =0v; v cc =5v 10%;f=0to40mhz. t a =-40 cto+85 c; v ss =0v; v cc =5v 10%. ( load capacitance for all outputs = 60 pf.) table 70 and table 74 give the description of each ac symbols. table 71, table 72 and table 73 give for each range the ac parameter. table 72 gives the frequency derating formula of the ac parameter for each speed range description. to calculate each ac symbols. take the x value and use this value in the formula. example: t lliv and 20 mhz, standard clock. x = 30 ns t = 50 ns t cciv = 4t - x = 170 ns serial port timing ? shift register mode table 70. symbol description (f = 40 mhz) table 71. ac parameters for a fix clock (f = 40 mhz) symbol parameter t xlxl serial port clock cycle time t qvhx output data set-up to clock rising edge t xhqx output data hold after clock rising edge t xhdx input data hold after clock rising edge t xhdv clock rising edge to input data valid symbol min max units t xlxl 300 ns t qvhx 200 ns t xhqx 30 ns t xhdx 0ns t xhdv 117 ns
96 t89c5115 4128a?8051?04/02 table 72. ac parameters for a variable clock shift register timing waveforms external clock drive characteristics (xtal1) table 73. ac parameters external clock drive waveforms ac testing input/output waveforms ac inputs during testing are driven at v cc - 0.5 for a logic ?1? and 0.45v for a logic ?0?. timing measurement are made at v ih min for a logic ?1? and v il max for a logic ?0?. symbol type standard clock x2 clock x parameter for -m range units t xlxl min 12t 6t ns t qvhx min 10t-x 5t-x 50 ns t xhqx min 2 t - x t - x 20 ns t xhdx min x x 0 ns t xhdv max 10 t - x 5 t- x 133 ns valid va l i d va li d valid valid valid input data valid 0123456 8 7 ale clock output data write to sbuf clear ri t xlxl t qvxh t xhqx t xhdv t xhdx set ti set ri instruction 01234567 valid symbol parameter min max units t clcl oscillator period 25 ns t chcx high time 5 ns t clcx low time 5 ns t clch rise time 5 ns t chcl fall time 5 ns t chcx /t clcx cyclicratioinx2mode 40 60 % v cc -0.5v 0.45v 0.7v cc 0.2v cc -0.1 t chcl t clcx t clcl t clch t chcx input/output 0.2 v cc +0.9 0.2 v cc -0.1 v cc -0.5v 0.45 v
97 t89c5115 4128a?8051?04/02 float waveforms for timing purposes as port pin is no longer floating when a 100 mv change from load voltage occurs and begins to float when a 100 mv change from the loaded v oh /v ol level occurs. i ol /i oh ? 20 ma. flash memory table 74. memory ac timing vdd = 5v 10% , ta = -40 to +85 c figure 45. flash memory - internal busy waveforms float v oh -0.1v v ol +0.1v v load v load +0.1v v load -0.1v symbol parameter min typ max unit t bhbl flash internal busy (programming) time 10 ms fbusy bit t bhbl
98 t89c5115 4128a?8051?04/02 ordering information table 75. possible order entries part-number memory size supply voltage temperature range max frequency package packing t89c5115-sisim 16k 5v industrial 40 mhz plcc28 stick T89C5115-TISIM 16k 5v industrial 40 mhz soic28 stick t89c5115-ratim 16k 5v industrial 40 mhz vqfp32 tray
99 t89c5115 4128a?8051?04/02 package drawing plcc28
100 t89c5115 4128a?8051?04/02 package drawing soic28
101 t89c5115 4128a?8051?04/02 package drawing vqfp32
i t89c5115 4128a?8051?04/02 table of contents features ................................................................................................. 1 description ............................................................................................ 1 block diagram ....................................................................................... 2 pin configuration .................................................................................. 3 i/o configurations................................................................................................. 6 port structure........................................................................................................ 6 read-modify-write instructions ............................................................................ 7 quasi-bidirectional port operation........................................................................ 7 sfr mapping ......................................................................................... 9 clock .................................................................................................... 13 description.......................................................................................................... 13 register .............................................................................................................. 16 power management ............................................................................ 17 introduction ......................................................................................................... 17 reset .................................................................................................................. 17 reset recommendation to prevent flash corruption ........................................ 17 idle mode ............................................................................................................ 18 power-down mode.............................................................................................. 18 registers..............................................................................................................20 data memory ....................................................................................... 21 internal space..................................................................................................... 21 dual data pointer ............................................................................................... 23 registers............................................................................................................. 24 eeprom data memory ....................................................................... 26 write data in the column latches ...................................................................... 26 programming ...................................................................................................... 26 read data........................................................................................................... 26 examples ............................................................................................................ 27 registers............................................................................................................. 28 program/code memory ...................................................................... 29 flash memory architecture................................................................................. 29 overview of fm0 operations .............................................................................. 31 registers............................................................................................................. 37
ii t89c5115 4128a?8051?04/02 in-system programming (isp) ........................................................... 38 flash programming and erasure........................................................................ 38 boot process ...................................................................................................... 39 application programming interface..................................................................... 40 xrow bytes....................................................................................................... 40 hardware security byte ...................................................................................... 41 serial i/o port ...................................................................................... 42 framing error detection .................................................................................... 42 automatic address recognition.......................................................................... 43 given address .....................................................................................................44 broadcast address ............................................................................................. 44 registers............................................................................................................. 45 timers/counters ................................................................................. 48 timer/counter operations .................................................................................. 48 timer 0................................................................................................................ 48 timer 1.................................................................................................................51 interrupt ...............................................................................................................52 registers............................................................................................................. 53 timer 2 ................................................................................................. 57 auto-reload mode ............................................................................................... 57 programmable clock-output .............................................................................. 58 registers............................................................................................................. 59 watchdog timer ................................................................................. 62 watchdog programming .....................................................................................63 watchdog timer during power-down mode and idle ...................... 64 register .............................................................................................................. 64 programmable counter array (pca) ................................................ 66 pca timer .......................................................................................................... 66 pca modules...................................................................................................... 68 pca interrupt...................................................................................................... 69 pca capture mode............................................................................................. 69 16-bit software timer mode ............................................................................... 70 high speed output mode ................................................................................... 71 pulse width modulator mode.............................................................................. 71 pca registers .................................................................................................... 73 analog-to-digital converter (adc) .................................................... 78 features.............................................................................................................. 78 adc port1 i/o functions .................................................................................... 78 adc converter operation................................................................................... 79
iii t89c5115 4128a?8051?04/02 voltage conversion ............................................................................................ 80 clock selection ................................................................................................... 80 adc standby mode ............................................................................................ 80 it adc management ...........................................................................................81 routine examples............................................................................................... 81 registers..............................................................................................................82 interrupt system ................................................................................. 84 introduction ......................................................................................................... 84 registers............................................................................................................. 86 electrical characteristics ................................................................... 92 absolute maximum ratings ................................................................................ 92 dc parameters for standard voltage ................................................................. 92 dc parameters for a/d converter ...................................................................... 94 ac parameters ....................................................................................................95 ordering information .......................................................................... 98 package drawing ................................................................................ 99 plcc28 .............................................................................................................. 99 package drawing .............................................................................. 100 soic28 ............................................................................................................. 100 package drawing .............................................................................. 101 vqfp32 ............................................................................................................ 101
printedonrecycledpaper. atmel ? , is a registered trademarkof atmel. other terms and product names may be the trademarks of others. ? atmel corporation 2002. atmel corporation makes no warranty for the use of its products, other than those expressly contained in the company?s standard warranty which is detailed in atmel?s terms and conditions located on the company?s web site. the company assumes no responsibility for any errors which may appear in this document, reserves the right to change devices or specifications detailed herein at any time without notice, and does not make any commitment to update the information contained herein. no licenses to patents or other intellectual property of atmel are granted by the company in connection with the sale of atmel products, expressly or by implication. atmel?s products are not authorized for use as critical components in life support devices or systems. atmel headquarters atmel operations corporate headquarters 2325 orchard parkway san jose, ca 95131 tel 1(408) 441-0311 fax 1(408) 487-2600 europe atmel sarl route des arsenaux 41 case postale 80 ch-1705 fribourg switzerland tel (41) 26-426-5555 fax (41) 26-426-5500 asia room 1219 chinachem golden plaza 77 mody road tsimhatsui east kowloon hong kong tel (852) 2721-9778 fax (852) 2722-1369 japan 9f, tonetsu shinkawa bldg. 1-24-8 shinkawa chuo-ku, tokyo 104-0033 japan tel (81) 3-3523-3551 fax (81) 3-3523-7581 memory 2325 orchard parkway san jose, ca 95131 tel 1(408) 441-0311 fax 1(408) 436-4314 microcontrollers 2325 orchard parkway san jose, ca 95131 tel 1(408) 441-0311 fax 1(408) 436-4314 la chantrerie bp 70602 44306 nantes cedex 3, france tel (33) 2-40-18-18-18 fax (33) 2-40-18-19-60 asic/assp/smart cards zone industrielle 13106 rousset cedex, france tel (33) 4-42-53-60-00 fax (33) 4-42-53-60-01 1150 east cheyenne mtn. blvd. colorado springs, co 80906 tel 1(719) 576-3300 fax 1(719) 540-1759 scottish enterprise technology park maxwell building east kilbride g75 0qr, scotland tel (44) 1355-803-000 fax (44) 1355-242-743 rf/automotive theresienstrasse 2 postfach 3535 74025 heilbronn, germany tel (49) 71-31-67-0 fax (49) 71-31-67-2340 1150 east cheyenne mtn. blvd. colorado springs, co 80906 tel 1(719) 576-3300 fax 1(719) 540-1759 biometrics/imaging/hi-rel mpu/ high speed converters/rf data- com avenue de rochepleine bp 123 38521 saint-egreve cedex, france tel (33) 4-76-58-30-00 fax (33) 4-76-58-34-80 e-mail literature@atmel.com web site http://www.atmel.com 4128a?8051?04/02 /xm


▲Up To Search▲   

 
Price & Availability of T89C5115-TISIM

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X